[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtk-developers
Subject:    Re: [vtk-developers] perf improvements to vtkDijkstra* classes -
From:       "David Cole" <david.cole () kitware ! com>
Date:       2008-08-28 20:05:46
Message-ID: f435c2c50808281305g5a18b5cfle6bcc5dfed5a6857 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


In VTK/Graphics/Testing/CMakeLists.txt, the list of header files occurring
after the VTK_GRAPHICS_EXPORT symbol is a list of "exceptions". Add your new
header file to that list since it does not declare a class that derives from
vtkObject.
HTH,
David


On Thu, Aug 28, 2008 at 3:57 PM, Dean Inglis <dean.inglis@camris.ca> wrote:

>
> Hi,
>
> In doing the PIMPL'ng I wrote vtkDijkstraGraphInternals.h
> to contain stl containers used be classes vtkDijkstraGraphGeodesicPath
> and vtkDijkstraImageGeodesicPath.  Im getting HeaderTesting-Graphics
> is failing for continuous build Darwin-ppc-cocoa-java:
>
> Use export macro: VTK_GRAPHICS_EXPORT
>
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h does not define any
> classes
>
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h has 2 includes:
>   24: #include &lt;vtkstd/vector&gt;
>   25: #include &lt;vtkstd/map&gt;
>
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h has non-portable
> include(s):
>   24: #include &lt;vtkstd/vector&gt;
>   25: #include &lt;vtkstd/map&gt;
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h does not have type
> macro
> Should be:
>  vtkTypeRevisionMacro(, );
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkDiscreteMarchingCubes.h does not define
> PrintSelf
> method:
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkHyperOctreeDepth.h does not define PrintSelf
> method:
> File: /Users/kitware/Dashboards/My
> Tests/VTK-cont/Graphics/vtkHyperOctreeLimiter.h does not define PrintSelf
> method:
>
> There were warnings:
> * No PrintSelf method
>
> There were errors:
> * Multiple includes
> * Non-portable includes
> * No type macro
> * No class defined
>
>
> Any ideas on how to fix this????
>
> thanks,
> Dean
>
>
>
> -----Original Message-----
> From: Amy Squillacote [mailto:ahs@cfdrc.com]
> Sent: August-28-08 8:49 AM
> To: Karthik Krishnan
> Cc: Dean Inglis; vtk-developers@vtk.org; 'Will Schroeder'
> Subject: Re: [vtk-developers] perf improvements to vtkDijkstra* classes
>
> Yes, the input type can absolutely be overwritten using
> FillInputPortInformation. For an example, see vtkContourFilter.
>
> - Amy
>
> Karthik Krishnan wrote:
> > Hi Dean:
> >
> > Thanks a lot for the contrib.
> >
> > I took a look at vtkDijkstraImageGeodesicPath and the first input
> > polydata is required but isn't used. The second input (cost function
> > image) is the one used.
> >
> > I think you can have a class deriving from vtkPolyDataAlgorithm that
> > has its first input as something other than vtkpolydata. This can be
> > done by overriding the method FillInputPortInformation and having the
> > first input be a vtkImageData. Can't it ?
> >
> > If not, maybe we should change vtkGeodesicPath to derive from
> > vtkAlgorithm.
> >
> > The other changes to vtkDijkstraGraphGeodesicPath look great.
> >
> > Thanks
> > --
> > karthik
> >
> > Dean Inglis wrote:
> >>
> >> Hi Will,
> >>
> >> thanks! Been having some fun here.
> >>
> >> Hi Karthik,
> >>
> >> I made a separate header file: vtkDijkstraGraphInternals that contains
> >>
> >> all the replacement stl containers so that
> >> vtkDijkstraGraphGeodesicPath and vtkDijkstraImageGeodesicPath
> >>
> >> have access. I left the implementation of the binary heap as is in
> >> vtkDijkstraGraphGeodesicPath
> >>
> >> with the exception that it now uses stl containers. I broke the cost
> >> function into "static"
> >>
> >> and "dynamic" parts so that edge costs can be calculated more
> >> efficiently. I have also
> >>
> >> taken the liberty to rename internal containers from things like
> >> this->f to this->OpenVertices
> >>
> >> as given in vtkDijkstraGraphInternals (see below). I will wait till
> >> tomorrow to commit in
> >>
> >> case you have any reservations or would like to discuss.
> >>
> >> thanks,
> >>
> >> Dean
> >>
> >> ------------------------------------------------------------------------
> >>
> >> *From:* Will Schroeder [mailto:will.schroeder@kitware.com]
> >> *Sent:* August-26-08 5:14 PM
> >> *To:* dean.inglis@camris.ca
> >> *Cc:* Karthik Krishnan
> >> *Subject:* Re: [vtk-developers] perf improvements to vtkDijkstra*
> >> classes
> >>
> >> I have no objections and have been doing similar things to other VTK
> >> classes. Great work!
> >> W
> >>
> >> 2008/8/26 Dean Inglis <dean.inglis@sympatico.ca
> >> <mailto:dean.inglis@sympatico.ca>>
> >>
> >> Is there any interest in (or objections to) PIMPL'ing some (or all) of
> >>
> >> the storage containers in vtkDijkstraGraphGeodesicPath?
> >>
> >> In a test class, I have reimplemented vtkDijkstraGraphGeodesicPath
> >>
> >> using the following substitutions and noticed substantial (qualitative)
> >>
> >> speed gains in interactivity:
> >>
> >> 1) - change containers f and s to vector<bool>
> >>
> >> 2) - change containers pre, Heap, and p to vector<int>
> >>
> >> 3) - change container for cost; d, to vector<float>
> >>
> >> 4) - change container for Adjacency from an array of vtkIdList* to
> >>
> >> vector<map<int,float>> for unique insertion of vertex id's and
> >>
> >> associated edge costs
> >>
> >> Probably most of the improvement comes from item 4) since
> >>
> >> you can pre-calculate all edge costs at the time of constructing
> >>
> >> the adjacency array, which only needs to be done when the input
> >>
> >> changes (not when start and end vertices change).
> >>
> >> Dean
> >>
> >>
> >> _______________________________________________
> >> vtk-developers mailing list
> >> vtk-developers@vtk.org <mailto:vtk-developers@vtk.org>
> >> http://www.vtk.org/mailman/listinfo/vtk-developers
> >>
> >>
> >>
> >>
> >> --
> >> William J. Schroeder, PhD
> >> Kitware, Inc.
> >> 28 Corporate Drive
> >> Clifton Park, NY 12065
> >> will.schroeder@kitware.com <mailto:will.schroeder@kitware.com>
> >> http://www.kitware.com
> >> 518-371-3971 (phone and fax)
> >>
> >
>
> --
> Amy Squillacote                    Phone: (256) 726-4839
> Computer Scientist                 Fax: (256) 726-4806
> CFD Research Corporation           Web: http://www.cfdrc.com
> 215 Wynn Drive, Suite 501
> Huntsville, AL  35805
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers@vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>

[Attachment #5 (text/html)]

<div dir="ltr">In VTK/Graphics/Testing/CMakeLists.txt, the list of header files \
occurring after the&nbsp;VTK_GRAPHICS_EXPORT symbol is a list of \
&quot;exceptions&quot;. Add your new header file to that list since it does not \
declare a class that derives from vtkObject.<div> \
<br></div><div>HTH,</div><div>David</div><div><br><br><div class="gmail_quote">On \
Thu, Aug 28, 2008 at 3:57 PM, Dean Inglis <span dir="ltr">&lt;<a \
href="mailto:dean.inglis@camris.ca">dean.inglis@camris.ca</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"><br> Hi,<br>
<br>
In doing the PIMPL&#39;ng I wrote vtkDijkstraGraphInternals.h<br>
to contain stl containers used be classes vtkDijkstraGraphGeodesicPath<br>
and vtkDijkstraImageGeodesicPath. &nbsp;Im getting HeaderTesting-Graphics<br>
is failing for continuous build Darwin-ppc-cocoa-java:<br>
<br>
Use export macro: VTK_GRAPHICS_EXPORT<br>
<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h does not define any<br>
classes<br>
<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h has 2 includes:<br>
 &nbsp; 24: #include &amp;lt;vtkstd/vector&amp;gt;<br>
 &nbsp; 25: #include &amp;lt;vtkstd/map&amp;gt;<br>
<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h has non-portable<br>
include(s):<br>
 &nbsp; 24: #include &amp;lt;vtkstd/vector&amp;gt;<br>
 &nbsp; 25: #include &amp;lt;vtkstd/map&amp;gt;<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkDijkstraGraphInternals.h does not have type macro<br>
Should be:<br>
&nbsp;vtkTypeRevisionMacro(, );<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkDiscreteMarchingCubes.h does not define PrintSelf<br>
method:<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkHyperOctreeDepth.h does not define PrintSelf<br>
method:<br>
File: /Users/kitware/Dashboards/My<br>
Tests/VTK-cont/Graphics/vtkHyperOctreeLimiter.h does not define PrintSelf<br>
method:<br>
<br>
There were warnings:<br>
* No PrintSelf method<br>
<br>
There were errors:<br>
* Multiple includes<br>
* Non-portable includes<br>
* No type macro<br>
* No class defined<br>
<br>
<br>
Any ideas on how to fix this????<br>
<br>
thanks,<br>
Dean<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: Amy Squillacote [mailto:<a href="mailto:ahs@cfdrc.com">ahs@cfdrc.com</a>]<br>
Sent: August-28-08 8:49 AM<br>
To: Karthik Krishnan<br>
Cc: Dean Inglis; <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>; \
                &#39;Will Schroeder&#39;<br>
Subject: Re: [vtk-developers] perf improvements to vtkDijkstra* classes<br>
<br>
Yes, the input type can absolutely be overwritten using<br>
FillInputPortInformation. For an example, see vtkContourFilter.<br>
<br>
- Amy<br>
<br>
Karthik Krishnan wrote:<br>
&gt; Hi Dean:<br>
&gt;<br>
&gt; Thanks a lot for the contrib.<br>
&gt;<br>
&gt; I took a look at vtkDijkstraImageGeodesicPath and the first input<br>
&gt; polydata is required but isn&#39;t used. The second input (cost function<br>
&gt; image) is the one used.<br>
&gt;<br>
&gt; I think you can have a class deriving from vtkPolyDataAlgorithm that<br>
&gt; has its first input as something other than vtkpolydata. This can be<br>
&gt; done by overriding the method FillInputPortInformation and having the<br>
&gt; first input be a vtkImageData. Can&#39;t it ?<br>
&gt;<br>
&gt; If not, maybe we should change vtkGeodesicPath to derive from<br>
&gt; vtkAlgorithm.<br>
&gt;<br>
&gt; The other changes to vtkDijkstraGraphGeodesicPath look great.<br>
&gt;<br>
&gt; Thanks<br>
&gt; --<br>
&gt; karthik<br>
&gt;<br>
&gt; Dean Inglis wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Will,<br>
&gt;&gt;<br>
&gt;&gt; thanks! Been having some fun here.<br>
&gt;&gt;<br>
&gt;&gt; Hi Karthik,<br>
&gt;&gt;<br>
&gt;&gt; I made a separate header file: vtkDijkstraGraphInternals that contains<br>
&gt;&gt;<br>
&gt;&gt; all the replacement stl containers so that<br>
&gt;&gt; vtkDijkstraGraphGeodesicPath and vtkDijkstraImageGeodesicPath<br>
&gt;&gt;<br>
&gt;&gt; have access. I left the implementation of the binary heap as is in<br>
&gt;&gt; vtkDijkstraGraphGeodesicPath<br>
&gt;&gt;<br>
&gt;&gt; with the exception that it now uses stl containers. I broke the cost<br>
&gt;&gt; function into &quot;static&quot;<br>
&gt;&gt;<br>
&gt;&gt; and &quot;dynamic&quot; parts so that edge costs can be calculated more<br>
&gt;&gt; efficiently. I have also<br>
&gt;&gt;<br>
&gt;&gt; taken the liberty to rename internal containers from things like<br>
&gt;&gt; this-&gt;f to this-&gt;OpenVertices<br>
&gt;&gt;<br>
&gt;&gt; as given in vtkDijkstraGraphInternals (see below). I will wait till<br>
&gt;&gt; tomorrow to commit in<br>
&gt;&gt;<br>
&gt;&gt; case you have any reservations or would like to discuss.<br>
&gt;&gt;<br>
&gt;&gt; thanks,<br>
&gt;&gt;<br>
&gt;&gt; Dean<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------------<br>
&gt;&gt;<br>
&gt;&gt; *From:* Will Schroeder [mailto:<a \
href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>]<br> &gt;&gt; \
*Sent:* August-26-08 5:14 PM<br> &gt;&gt; *To:* <a \
href="mailto:dean.inglis@camris.ca">dean.inglis@camris.ca</a><br> &gt;&gt; *Cc:* \
Karthik Krishnan<br> &gt;&gt; *Subject:* Re: [vtk-developers] perf improvements to \
vtkDijkstra*<br> &gt;&gt; classes<br>
&gt;&gt;<br>
&gt;&gt; I have no objections and have been doing similar things to other VTK<br>
&gt;&gt; classes. Great work!<br>
&gt;&gt; W<br>
&gt;&gt;<br>
&gt;&gt; 2008/8/26 Dean Inglis &lt;<a \
href="mailto:dean.inglis@sympatico.ca">dean.inglis@sympatico.ca</a><br> &gt;&gt; \
&lt;mailto:<a href="mailto:dean.inglis@sympatico.ca">dean.inglis@sympatico.ca</a>&gt;&gt;<br>
 &gt;&gt;<br>
&gt;&gt; Is there any interest in (or objections to) PIMPL&#39;ing some (or all) \
of<br> &gt;&gt;<br>
&gt;&gt; the storage containers in vtkDijkstraGraphGeodesicPath?<br>
&gt;&gt;<br>
&gt;&gt; In a test class, I have reimplemented vtkDijkstraGraphGeodesicPath<br>
&gt;&gt;<br>
&gt;&gt; using the following substitutions and noticed substantial (qualitative)<br>
&gt;&gt;<br>
&gt;&gt; speed gains in interactivity:<br>
&gt;&gt;<br>
&gt;&gt; 1) - change containers f and s to vector&lt;bool&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2) - change containers pre, Heap, and p to vector&lt;int&gt;<br>
&gt;&gt;<br>
&gt;&gt; 3) - change container for cost; d, to vector&lt;float&gt;<br>
&gt;&gt;<br>
&gt;&gt; 4) - change container for Adjacency from an array of vtkIdList* to<br>
&gt;&gt;<br>
&gt;&gt; vector&lt;map&lt;int,float&gt;&gt; for unique insertion of vertex id&#39;s \
and<br> &gt;&gt;<br>
&gt;&gt; associated edge costs<br>
&gt;&gt;<br>
&gt;&gt; Probably most of the improvement comes from item 4) since<br>
&gt;&gt;<br>
&gt;&gt; you can pre-calculate all edge costs at the time of constructing<br>
&gt;&gt;<br>
&gt;&gt; the adjacency array, which only needs to be done when the input<br>
&gt;&gt;<br>
&gt;&gt; changes (not when start and end vertices change).<br>
&gt;&gt;<br>
&gt;&gt; Dean<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; vtk-developers mailing list<br>
&gt;&gt; <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a> \
&lt;mailto:<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>&gt;<br> \
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" \
target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br> \
&gt;&gt;<br> &gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; William J. Schroeder, PhD<br>
&gt;&gt; Kitware, Inc.<br>
&gt;&gt; 28 Corporate Drive<br>
&gt;&gt; Clifton Park, NY 12065<br>
&gt;&gt; <a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a> \
&lt;mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>&gt;<br>
 &gt;&gt; <a href="http://www.kitware.com" \
target="_blank">http://www.kitware.com</a><br> &gt;&gt; 518-371-3971 (phone and \
fax)<br> &gt;&gt;<br>
&gt;<br>
<br>
--<br>
Amy Squillacote &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;Phone: (256) 726-4839<br> Computer Scientist &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; Fax: (256) 726-4806<br> CFD Research Corporation &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; Web: <a href="http://www.cfdrc.com" \
target="_blank">http://www.cfdrc.com</a><br> 215 Wynn Drive, Suite 501<br>
Huntsville, AL &nbsp;35805<br>
<br>
<br>
_______________________________________________<br>
vtk-developers mailing list<br>
<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" \
target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br> \
</blockquote></div><br></div></div>



_______________________________________________
vtk-developers mailing list
vtk-developers@vtk.org
http://www.vtk.org/mailman/listinfo/vtk-developers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic