4×4 Array{Int64,2}:
0 1 2 3
1 0 4 5
2 4 0 6
3 5 6 0
a symetric matrix m[i,j] =m[j,i] and m[i,i]= 0
On Fri, Aug 19, 2016 at 3:59 PM, Jeffrey Sarnoff <[email protected]>
wrote:
> Is this what you want, or are you looking for a more general way to
> construct nxn matrices like this 4x4 matrix, or something else?
>
> julia> m = [ [0,1,2,3] [1,0,4,5] [2,3,0,6] [4,5,6,0] ]
> 4×4 Array{Int64,2}:
> 0 1 2 4
> 1 0 3 5
> 2 4 0 6
> 3 5 6 0
>
>
> On Friday, August 19, 2016 at 9:01:06 AM UTC-4, Ahmed Mazari wrote:
>>
>> Yes but it doesn't allow me to set the diagonal to 0 ??
>>
>> On Fri, Aug 19, 2016 at 2:55 PM, Michael Borregaard <[email protected]>
>> wrote:
>>
>>> You can build the matrix as normal, then specify that the upper triangle
>>> is undefined by
>>> mat = LowerTriangular(mat) # where mat is a Matrix of any eltype.
>>>
>>
>>