コード例 #1
0
    /*!
     * \brief Sum a value into existing value at the local row index. The
     * local index must exist on process.
     */
    static void sumIntoLocalValue( vector_type& vector,
    				   local_ordinal_type local_row,
    				   const scalar_type& value )
    {
	MCLS_REQUIRE( vector.getMap()->isNodeLocalElement( local_row ) );
	vector.sumIntoLocalValue( local_row, value );
    }
コード例 #2
0
    /*!
     * \brief Sum a value into existing value at the global row index. The
     * global index must exist on process.
     */
    static void sumIntoGlobalValue( vector_type& vector,
    				    global_ordinal_type global_row,
    				    const scalar_type& value )
    {
	MCLS_REQUIRE( vector.getMap()->isNodeGlobalElement( global_row ) );
	vector.sumIntoGlobalValue( global_row, value );
    }
コード例 #3
0
    /*!
     * \brief Get the communicator.
     */
    static Teuchos::RCP<const Teuchos::Comm<int> >
    getComm( const vector_type& vector )
    {
	return vector.getMap()->getComm();
    }
コード例 #4
0
    /*!
     * \brief Create a reference-counted pointer to a new empty vector with
     * the same parallel distribution as the given vector.
     */
    static Teuchos::RCP<vector_type> clone( const vector_type& vector )
    {
	return Tpetra::createVector<Scalar,LO,GO>( vector.getMap() );
    }
コード例 #5
0
    /*!
     * \brief Given a global row on-process, provide the local ordinal.
     */
    static local_ordinal_type
    getLocalRow( const vector_type& vector,
		 const global_ordinal_type& global_row )
    { 
	return vector.getMap()->getLocalElement( global_row );
    }
コード例 #6
0
    /*!
     * \brief Given a local row on-process, provide the global ordinal.
     */
    static global_ordinal_type 
    getGlobalRow( const vector_type& vector, 
		  const local_ordinal_type& local_row )
    { 
	return vector.getMap()->getGlobalElement( local_row );
    }
コード例 #7
0
    /*!
     * \brief Determine whether or not a given local row is on-process.
     */
    static bool isLocalRow( const vector_type& vector,
			    const local_ordinal_type& local_row )
    {
	return vector.getMap()->isNodeLocalElement( local_row );
    }
コード例 #8
0
    /*!
     * \brief Determine whether or not a given global row is on-process.
     */
    static bool isGlobalRow( const vector_type& vector,
			     const global_ordinal_type& global_row )
    {
	return vector.getMap()->isNodeGlobalElement( global_row );
    }