Le 17/01/2014 00:15, martin p cristia a écrit :
> I need this global matrix:
>
> Public MatRigGlo[12, 12] As Float
>
> that in some cases it needs to be [3,3] or [6,6]
> I pass that matrix to a C library:
>
> Public Extern M8simetrizarSQ(matriz As Float[], lOrden As Long)
>
> and the call is
>
>    M8simetrizarSQ(MatRigGlo, 12)
>
> wich works perfectly. But its ineficient because if matrix is 3x3, the
> routine still need to process it like 12x12, and that matrix it's filled
> like 1M times. Will it work like this?
>
> Public Mat3[3,3] as Float
> Public Mat12[12,12] as Float
> Public MatRigGlo as Float[]
>
> ' Module
> MatrigGlo = Mat3
>
> and the use MatRigGlo like a 3x3 matrix?
> wich other ways to do this?
>
> tnx
>

No, because Mat3 and Mat12 are not normal Float arrays, but embedded 
Float arrays.

You must declare them that way:

Public Mat3 As Float[3, 3]
Public Mat12 As Float[12, 12]

Or dynamically:

Public MatRigGlo as Float[]

MatRigGlo = New Float[iSize, iSize]

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to