[vtk-developers] vtkMath::Dot2D

David Gobbi david.gobbi at gmail.com
Wed Dec 9 18:53:21 EST 2009


The array length is used by the wrappers (at least by the python
wrappers) to decide what tuple sizes to require as parameters to the
wrapped method.  So a python user, for example, would have to convert
the two-tuples vectors into three-tuples in order to use this
signature.

   David


On Wed, Dec 9, 2009 at 4:11 PM, Moreland, Kenneth <kmorel at sandia.gov> wrote:
> My guess would be that that is a copy-paste error.  Change it to 2-vectors
> is probably the right thing to do.
>
> AFAIK, the array declaration in a function/method argument is treated just
> like a pointer.  C++ does not do any range checking.  I think it just serves
> to help document what size array you expect.
>
> -Ken
>
>
> On 12/9/09 3:57 PM, "David Doria" <daviddoria+vtk at gmail.com> wrote:
>
> Is there any reason:
>
>   // Description:
>   // Dot product of two 2-vectors. The third (z) component is
>   // ignored (double-precision version).
>   static double Dot2D(const double x[3], const double y[3]) {
>     return ( x[0] * y[0] + x[1] * y[1] );};
>
> needs to accept 3-vectors and talk about how it ignores the last
> component? Couldn't it just be:
>
>   // Description:
>   // Dot product of two 2-vectors. (double-precision version).
>   static double Dot2D(const double x[2], const double y[2]) {
>     return ( x[0] * y[0] + x[1] * y[1] );};
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
>
>
>    ****      Kenneth Moreland
>     ***      Sandia National Laboratories
> ***********
> *** *** ***  email: kmorel at sandia.gov
> **  ***  **  phone: (505) 844-8919
>     ***      web:   http://www.cs.unm.edu/~kmorel
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>



More information about the vtk-developers mailing list