I doubt that that function is convex but you can try implementing it with CVXR and it will tell you if it is not.
At any rate we can do it with a general nonlinear optimizer such as optim
. Define a function ontof
that maps R^m onto the feasible region and then we can implement it as below. Try it from multiple starting points just to be sure.
# test input
m <- 2
n <- 3
A <- matrix(1:(m*n), m, n)
ontof <- function(w) w*w / sum(w*w)
obj <- function(w) sum( sum(w*w) / colSums(A * w) )
res <- optim(1:m, function(x) obj(ontof(x)))
str(res)
## List of 5
## $ par : num [1:2] 1.37 1.55
## $ value : num 0.559
## $ counts : Named int [1:2] 39 NA
## ..- attr(*, "names")= chr [1:2] "function" "gradient"
## $ convergence: int 0
## $ message : NULL
ontof(res$par) # solution
## [1] 0.4398606 0.5601394