[ITK] [ITK-dev] efficiency of vnl_matrix

Jian Cheng jian.cheng.1983 at gmail.com
Thu Mar 12 10:01:47 EDT 2015


Hi,

I did test some mature matrix libs.
Compared to eigen, I prefer armadillo http://arma.sourceforge.net/,
because armadillo is more efficient for my task based on my experiments.
Someone wrote did a numerical comparison on pseudo-inverse.
http://nghiaho.com/?p=1726
Thus for picking a mature library, I vote for armadillo.

I decided to write my own matrix class for the codes, because it does
not need to add additional dependency and it just contains 2-3 header
files for a light-wright matrix lib to support blas, lapack, mkl, and
expression template.

best,
Jian Cheng

On 03/12/2015 05:15 AM, M.Staring at lumc.nl wrote:
> Hi,
>
> I think the eigen library is a mature and very fast library for these kind of things:
> http://eigen.tuxfamily.org/index.php?title=Main_Page
>
> You may want to check it out, to see if it offers what you need.
>
> It would be great to be able to use these within the itk.
>
> 2c
> Marius
>
> -----Original Message-----
> From: Insight-developers [mailto:insight-developers-bounces at itk.org] On Behalf Of Jian Cheng
> Sent: Wednesday, March 11, 2015 23:17
> To: Matt McCormick
> Cc: Chuck Atkins; ITK
> Subject: Re: [ITK-dev] efficiency of vnl_matrix
>
> Hi Matt,
>
> Thanks for your help, and also for the ITK workshop in UNC last time.
>
> It is very unfortunate. The efficiency of these numerical math operators are very important for many applications.
>
> I recently released an ITK based toolbox, called dmritool, for diffusion MRI data processing.
> It has some files to add some supports of blas, lapack, mkl to vnl_matrix and vnl_vector.
> http://diffusionmritool.github.io/dmritool_doxygen/utlBlas_8h_source.html
> http://diffusionmritool.github.io/dmritool_doxygen/utlVNLBlas_8h_source.html
>
> Those functions are not internally for vnl_matrix class. They are operators for the data pointer stored in vnl_matrix object.
> Thus, later I made a N-dimensional array library which internally includes those functions, and also supports expression template to avoid temporary copies.
> http://diffusionmritool.github.io/dmritool_doxygen/utlMatrix_8h_source.html
> http://diffusionmritool.github.io/dmritool_doxygen/utlVector_8h_source.html
>
> The efficiency comparison between vnl_vector/vnl_matrix and the vector/matrix using openblas, lapack, or mkl can be found by running those two tests https://github.com/DiffusionMRITool/dmritool/blob/master/Modules/HelperFunctions/test/utlVNLBlasGTest.cxx
> https://github.com/DiffusionMRITool/dmritool/blob/master/Modules/HelperFunctions/test/utlVNLLapackGTest.cxx
>
> Maybe some codes can be used as patches in somewhere in ITK. I am not sure. Maybe we need more discussion on it.
> With your help and discussion, I will be very glad to make my first patch to ITK.
> Thanks.
>
> best,
> Jian Cheng
>
>
> On 03/11/2015 04:39 PM, Matt McCormick wrote:
>> Hi Jian,
>>
>> Yes, it would be wonderful to improve the efficiency of these basic 
>> numerical operations.
>>
>> Funding for the Refactor Numerical Libraries has currently ended, and 
>> the effort is currently frozen.  However, you are more than welcome to 
>> pick it up and we can help you get it into ITK.  More information on 
>> the patch submission process can be found here [1] and in the ITK 
>> Software Guide.
>>
>> Thanks,
>> Matt
>>
>> [1] 
>> https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySo
>> ftwareProcess/SubmitAPatchToGerrit/index.html
>>
>> On Wed, Mar 11, 2015 at 4:07 PM, Jian Cheng <jian.cheng.1983 at gmail.com> wrote:
>>> Hi,
>>>
>>> My task using ITK has intensive matrix-matrix product, pseudo-inverse, etc.
>>> Thus the performance is actually mainly determined by the matrix 
>>> library I used.
>>> Firstly I use vnl_matrix and vnl_vector in ITK. Then I found it is 
>>> very inefficient because vnl matrix lib does not use blas and lapack.
>>> After I wrote my own matrix class which uses openblas and lapack, I 
>>> got a hug gain of performance.
>>>
>>> I found there is a proposal to improve the efficiency of numerical 
>>> libraries in ITK.
>>> http://www.itk.org/Wiki/ITK/Release_4/Refactor_Numerical_Libraries
>>> I am not sure how is the progress of the proposal.
>>> I wonder when the vnl matrix lib can internally support blas and 
>>> lapack, or mkl, so that we can just use it without lose of the efficiency.
>>> Thanks.
>>>
>>> best,
>>> Jian Cheng
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at 
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://kitware.com/products/protraining.php
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/insight-developers
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list