Loading src/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,9 @@ ADD_SUBDIRECTORY( functors ) ADD_SUBDIRECTORY( config ) ADD_SUBDIRECTORY( core ) ADD_SUBDIRECTORY( debug ) ADD_SUBDIRECTORY( graphs ) ADD_SUBDIRECTORY( matrices ) ADD_SUBDIRECTORY( mesh ) ADD_SUBDIRECTORY( networks ) ADD_SUBDIRECTORY( operators ) ADD_SUBDIRECTORY( problems ) ADD_SUBDIRECTORY( solvers ) Loading src/graphs/CMakeLists.txt→src/networks/CMakeLists.txt +4 −4 Original line number Diff line number Diff line Loading @@ -3,18 +3,18 @@ SET( headers tnlEllpackGraph.h tnlEllpackGraphLinksAccessor.h tnlEllpackGraphLinksAccessor_impl.h ) SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/graphs ) SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/networks ) set( common_SOURCES ) IF( BUILD_CUDA ) set( tnl_graphs_CUDA__SOURCES set( tnl_networks_CUDA__SOURCES ${common_SOURCES} PARENT_SCOPE ) ENDIF() set( tnl_graphs_SOURCES set( tnl_networks_SOURCES ${common_SOURCES} PARENT_SCOPE ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/graphs ) No newline at end of file INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/networks ) No newline at end of file src/graphs/tnlEllpackGraph.h→src/networks/tnlEllpackNetwork.h +24 −18 Original line number Diff line number Diff line /*************************************************************************** tnlEllpackGraph.h - description tnlEllpackNetwork.h - description ------------------- begin : Sep 9, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. Loading @@ -15,44 +15,50 @@ * * ***************************************************************************/ #ifndef TNLELLPACKGRAPH_H #define TNLELLPACKGRAPH_H #ifndef TNLELLPACKNETWORK_H #define TNLELLPACKNETWORK_H #include <graphs/sparse/tnlEllpackGraphLinksAccessor.h> #include <networks/tnlEllpackNetworkPorts.h> template< typename Device = tnlHost, typename Index = int > class tnlEllpackGraphConstLinksAccessor; class tnlEllpackNetworkConstPorts; template< typename Device = tnlHost, typename Index = int > class tnlEllpackGraph class tnlEllpackNetwork { public: typedef Device DeviceType; typedef Index IndexType; typedef tnlEllpackGraphLinksAccessor< DeviceType, IndexType > LinksAccessorType; typedef tnlEllpackGraphConstLinksAccessor< DeviceType, IndexType > ConstLinksAccessorType; typedef tnlVector< IndexType, DeviceType, IndexType > LinksPerNodesVectorType; typedef tnlEllpackNetworkPorts< DeviceType, IndexType > PortsType; typedef tnlEllpackNetworkConstPorts< DeviceType, IndexType > ConstPortsType; typedef tnlVector< IndexType, DeviceType, IndexType > PortsAllocationVectorType; tnlEllpackGraph(); tnlEllpackNetwork(); void setNumberOfNodes( const IndexType nodes ); void setDimensions( const IndexType inputs, const IndexType outputs ); void setNumberOfLinksPerNode( const LinksPerNodesVectorType& linksPerNode ); const IndexType getInputsCount() const; LinksAccessorType getNodeLinksAccessor( const IndexType& nodeIndex ); const IndexType getOutputsCount() const; ConstLinksAccessorType getNodeLinksAccessor( const IndexType& nodeIndex ) const; void allocatePorts( const PortsAllocationVectorType& portsCount ); PortsType getPorts( const IndexType& inputIndex ); ConstPortsType getPorts( const IndexType& inputIndex ) const; protected: tnlVector< IndexType, DeviceType, IndexType > links; IndexType maxLinksPerNode, numberOfNodes; IndexType inputs, outputs, portsMaxCount; }; #include <networks/tnlEllpackNetworks_impl.h> #endif /* TNLELLPACKGRAPH_H */ #endif /* TNLELLPACKNETWORK_H */ src/graphs/tnlEllpackGraphLinksAccessor.h→src/networks/tnlEllpackNetworkPorts.h +20 −20 Original line number Diff line number Diff line /*************************************************************************** tnlEllpackGraph.h - description tnlEllpackNetworkPorts.h - description ------------------- begin : Sep 10, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. Loading @@ -15,43 +15,43 @@ * * ***************************************************************************/ #ifndef TNLELLPACKGRAPHLINKSACCESSOR_H #define TNLELLPACKGRAPHLINKSACCESSOR_H #ifndef TNLELLPACKNETWORKPORTS_H #define TNLELLPACKNETWORKPORTS_H template< typename Device, typename Index > class tnlEllpackGraphLinksAccessor class tnlEllpackNetworkPorts { public: typedef Device DeviceType; typedef Index IndexType; typedef tnlEllpackGraph< DeviceType, IndexType > GraphType; typedef tnlEllpackNetwork< DeviceType, IndexType > NetworkType; void setLink( const IndexType linkIndex, const IndexType targetNode ); void setOutput( const IndexType portIndex, const IndexType output ); IndexType getLinkTarget( const IndexType linkIndex ) const; IndexType getOutput( const IndexType portIndex ) const; IndexType& operator[]( const IndexType linkIndex ); IndexType& operator[]( const IndexType portIndex ); const IndexType& operator[]( const IndexType linkIndex ) const; const IndexType& operator[]( const IndexType portIndex ) const; protected: tnlEllpackGraphLinksAccessor( IndexType* graphLinks, const IndexType node, const maxLinksPerNode ); tnlEllpackNetworkPorts( IndexType* ports, const IndexType input, const IndexType portsMaxCount ); IndexType* links; IndexType* ports; IndexType step, maxLinksPerNode; IndexType step; friend tnlEllpackGraph< IndexType, DeviceType >; friend tnlEllpackNetwork< IndexType, DeviceType >; }; #include <graphs/sparse/tnlEllpackGraphLinksAccessor_impl.h> #include <networks/tnlEllpackNetworkPorts_impl.h> #endif /* TNLELLPACKGRAPHLINKSACCESSOR_H */ #endif /* TNLELLPACKNETWORKPORTS_H */ src/graphs/tnlEllpackGraphLinksAccessor_impl.h→src/networks/tnlEllpackNetworkPorts_impl.h +22 −22 Original line number Diff line number Diff line /*************************************************************************** tnlEllpackGraph_impl.h - description tnlEllpackNetworkPorts_impl.h - description ------------------- begin : Sep 10, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. Loading @@ -15,56 +15,56 @@ * * ***************************************************************************/ #ifndef TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H #define TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H #ifndef TNLELLPACKNETWORKPORTS_IMPL_H #define TNLELLPACKNETWORKPORTS_IMPL_H template< typename Device, typename Index > tnlEllpackGraphLinksAccessor< Device, Index >:: tnlEllpackGraphLinksAccessor( IndexType* graphLinks, const IndexType node, const IndexType maxLinksPerNode ) tnlEllpackNetworkPorts< Device, Index >:: tnlEllpackNetworkPorts( IndexType* networkPorts, const IndexType input, const IndexType portsMaxCount ) { this->links = &graphLinks[ node * maxLinksPerNode ]; this->maxLinksPerNode = maxLinksPerNode; this->ports = &networkPorts[ input * portsMaxCount ]; this->portsMaxCount = portsMaxCount; } template< typename Device, typename Index > void tnlEllpackGraphLinksAccessor< Device, Index >:: setLink( const IndexType linkIndex, const IndexType targetNode ) tnlEllpackNetworkPorts< Device, Index >:: setOutput( const IndexType portIndex, const IndexType output ) { links[ linkIndex ] = targetNode; this->ports[ portIndex ] = ouput; } template< typename Device, typename Index > Index tnlEllpackGraphLinksAccessor< Device, Index >:: getLinkTarget( const IndexType linkIndex ) const tnlEllpackNetworkPorts< Device, Index >:: getOutput( const IndexType portIndex ) const { return links[ linkIndex ]; return this->ports[ portIndex ]; } template< typename Device, typename Index > Index& tnlEllpackGraphLinksAccessor< Device, Index >:: operator[]( const IndexType linkIndex ) tnlEllpackNetworkPorts< Device, Index >:: operator[]( const IndexType portIndex ) { return links[ linkIndex ]; return this->ports[ portIndex ]; } template< typename Device, typename Index > const Index& tnlEllpackGraphLinksAccessor< Device, Index >:: operator[]( const IndexType linkIndex ) const tnlEllpackNetworkPorts< Device, Index >:: operator[]( const IndexType portIndex ) const { return links[ linkIndex ]; return this->ports[ portIndex ]; } Loading Loading
src/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,9 @@ ADD_SUBDIRECTORY( functors ) ADD_SUBDIRECTORY( config ) ADD_SUBDIRECTORY( core ) ADD_SUBDIRECTORY( debug ) ADD_SUBDIRECTORY( graphs ) ADD_SUBDIRECTORY( matrices ) ADD_SUBDIRECTORY( mesh ) ADD_SUBDIRECTORY( networks ) ADD_SUBDIRECTORY( operators ) ADD_SUBDIRECTORY( problems ) ADD_SUBDIRECTORY( solvers ) Loading
src/graphs/CMakeLists.txt→src/networks/CMakeLists.txt +4 −4 Original line number Diff line number Diff line Loading @@ -3,18 +3,18 @@ SET( headers tnlEllpackGraph.h tnlEllpackGraphLinksAccessor.h tnlEllpackGraphLinksAccessor_impl.h ) SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/graphs ) SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/networks ) set( common_SOURCES ) IF( BUILD_CUDA ) set( tnl_graphs_CUDA__SOURCES set( tnl_networks_CUDA__SOURCES ${common_SOURCES} PARENT_SCOPE ) ENDIF() set( tnl_graphs_SOURCES set( tnl_networks_SOURCES ${common_SOURCES} PARENT_SCOPE ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/graphs ) No newline at end of file INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/networks ) No newline at end of file
src/graphs/tnlEllpackGraph.h→src/networks/tnlEllpackNetwork.h +24 −18 Original line number Diff line number Diff line /*************************************************************************** tnlEllpackGraph.h - description tnlEllpackNetwork.h - description ------------------- begin : Sep 9, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. Loading @@ -15,44 +15,50 @@ * * ***************************************************************************/ #ifndef TNLELLPACKGRAPH_H #define TNLELLPACKGRAPH_H #ifndef TNLELLPACKNETWORK_H #define TNLELLPACKNETWORK_H #include <graphs/sparse/tnlEllpackGraphLinksAccessor.h> #include <networks/tnlEllpackNetworkPorts.h> template< typename Device = tnlHost, typename Index = int > class tnlEllpackGraphConstLinksAccessor; class tnlEllpackNetworkConstPorts; template< typename Device = tnlHost, typename Index = int > class tnlEllpackGraph class tnlEllpackNetwork { public: typedef Device DeviceType; typedef Index IndexType; typedef tnlEllpackGraphLinksAccessor< DeviceType, IndexType > LinksAccessorType; typedef tnlEllpackGraphConstLinksAccessor< DeviceType, IndexType > ConstLinksAccessorType; typedef tnlVector< IndexType, DeviceType, IndexType > LinksPerNodesVectorType; typedef tnlEllpackNetworkPorts< DeviceType, IndexType > PortsType; typedef tnlEllpackNetworkConstPorts< DeviceType, IndexType > ConstPortsType; typedef tnlVector< IndexType, DeviceType, IndexType > PortsAllocationVectorType; tnlEllpackGraph(); tnlEllpackNetwork(); void setNumberOfNodes( const IndexType nodes ); void setDimensions( const IndexType inputs, const IndexType outputs ); void setNumberOfLinksPerNode( const LinksPerNodesVectorType& linksPerNode ); const IndexType getInputsCount() const; LinksAccessorType getNodeLinksAccessor( const IndexType& nodeIndex ); const IndexType getOutputsCount() const; ConstLinksAccessorType getNodeLinksAccessor( const IndexType& nodeIndex ) const; void allocatePorts( const PortsAllocationVectorType& portsCount ); PortsType getPorts( const IndexType& inputIndex ); ConstPortsType getPorts( const IndexType& inputIndex ) const; protected: tnlVector< IndexType, DeviceType, IndexType > links; IndexType maxLinksPerNode, numberOfNodes; IndexType inputs, outputs, portsMaxCount; }; #include <networks/tnlEllpackNetworks_impl.h> #endif /* TNLELLPACKGRAPH_H */ #endif /* TNLELLPACKNETWORK_H */
src/graphs/tnlEllpackGraphLinksAccessor.h→src/networks/tnlEllpackNetworkPorts.h +20 −20 Original line number Diff line number Diff line /*************************************************************************** tnlEllpackGraph.h - description tnlEllpackNetworkPorts.h - description ------------------- begin : Sep 10, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. Loading @@ -15,43 +15,43 @@ * * ***************************************************************************/ #ifndef TNLELLPACKGRAPHLINKSACCESSOR_H #define TNLELLPACKGRAPHLINKSACCESSOR_H #ifndef TNLELLPACKNETWORKPORTS_H #define TNLELLPACKNETWORKPORTS_H template< typename Device, typename Index > class tnlEllpackGraphLinksAccessor class tnlEllpackNetworkPorts { public: typedef Device DeviceType; typedef Index IndexType; typedef tnlEllpackGraph< DeviceType, IndexType > GraphType; typedef tnlEllpackNetwork< DeviceType, IndexType > NetworkType; void setLink( const IndexType linkIndex, const IndexType targetNode ); void setOutput( const IndexType portIndex, const IndexType output ); IndexType getLinkTarget( const IndexType linkIndex ) const; IndexType getOutput( const IndexType portIndex ) const; IndexType& operator[]( const IndexType linkIndex ); IndexType& operator[]( const IndexType portIndex ); const IndexType& operator[]( const IndexType linkIndex ) const; const IndexType& operator[]( const IndexType portIndex ) const; protected: tnlEllpackGraphLinksAccessor( IndexType* graphLinks, const IndexType node, const maxLinksPerNode ); tnlEllpackNetworkPorts( IndexType* ports, const IndexType input, const IndexType portsMaxCount ); IndexType* links; IndexType* ports; IndexType step, maxLinksPerNode; IndexType step; friend tnlEllpackGraph< IndexType, DeviceType >; friend tnlEllpackNetwork< IndexType, DeviceType >; }; #include <graphs/sparse/tnlEllpackGraphLinksAccessor_impl.h> #include <networks/tnlEllpackNetworkPorts_impl.h> #endif /* TNLELLPACKGRAPHLINKSACCESSOR_H */ #endif /* TNLELLPACKNETWORKPORTS_H */
src/graphs/tnlEllpackGraphLinksAccessor_impl.h→src/networks/tnlEllpackNetworkPorts_impl.h +22 −22 Original line number Diff line number Diff line /*************************************************************************** tnlEllpackGraph_impl.h - description tnlEllpackNetworkPorts_impl.h - description ------------------- begin : Sep 10, 2015 copyright : (C) 2015 by Tomas Oberhuber et al. Loading @@ -15,56 +15,56 @@ * * ***************************************************************************/ #ifndef TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H #define TNLELLPACKGRAPHLINKSACCESSOR_IMPL_H #ifndef TNLELLPACKNETWORKPORTS_IMPL_H #define TNLELLPACKNETWORKPORTS_IMPL_H template< typename Device, typename Index > tnlEllpackGraphLinksAccessor< Device, Index >:: tnlEllpackGraphLinksAccessor( IndexType* graphLinks, const IndexType node, const IndexType maxLinksPerNode ) tnlEllpackNetworkPorts< Device, Index >:: tnlEllpackNetworkPorts( IndexType* networkPorts, const IndexType input, const IndexType portsMaxCount ) { this->links = &graphLinks[ node * maxLinksPerNode ]; this->maxLinksPerNode = maxLinksPerNode; this->ports = &networkPorts[ input * portsMaxCount ]; this->portsMaxCount = portsMaxCount; } template< typename Device, typename Index > void tnlEllpackGraphLinksAccessor< Device, Index >:: setLink( const IndexType linkIndex, const IndexType targetNode ) tnlEllpackNetworkPorts< Device, Index >:: setOutput( const IndexType portIndex, const IndexType output ) { links[ linkIndex ] = targetNode; this->ports[ portIndex ] = ouput; } template< typename Device, typename Index > Index tnlEllpackGraphLinksAccessor< Device, Index >:: getLinkTarget( const IndexType linkIndex ) const tnlEllpackNetworkPorts< Device, Index >:: getOutput( const IndexType portIndex ) const { return links[ linkIndex ]; return this->ports[ portIndex ]; } template< typename Device, typename Index > Index& tnlEllpackGraphLinksAccessor< Device, Index >:: operator[]( const IndexType linkIndex ) tnlEllpackNetworkPorts< Device, Index >:: operator[]( const IndexType portIndex ) { return links[ linkIndex ]; return this->ports[ portIndex ]; } template< typename Device, typename Index > const Index& tnlEllpackGraphLinksAccessor< Device, Index >:: operator[]( const IndexType linkIndex ) const tnlEllpackNetworkPorts< Device, Index >:: operator[]( const IndexType portIndex ) const { return links[ linkIndex ]; return this->ports[ portIndex ]; } Loading