packages/Matprop/xs/Mix_Table.cc
//---------------------------------------------------------------------------//
/*!
 * \brief Get the COO representation of this table.
 *
 * The input views must be sized to the number of elements in the table.
 */
\brief Get the COO representation of this table.
The input views must be sized to the number of elements in the table.
\ brief Get the COO representation of this table . The input views must be sized to the number of elements in the table .
void Mix_Table::to_coo(View_Mat row, View_Mat col, View_Frac val) const
{
    REQUIRE(row.size() == num_elements());
    REQUIRE(col.size() == num_elements());
    REQUIRE(val.size() == num_elements());
    auto r = row.begin();
    auto c = col.begin();
    auto v = val.begin();
    for (auto row_index : profugus::range(d_table.num_rows()))
    {
        auto view = d_table.row(row_index);
        for (const Matid_Frac& kv : view)
        {
            *r++ = row_index;
            *c++ = kv.first;
            *v++ = kv.second;
        }
    }
    ENSURE(r == row.end());
    ENSURE(c == col.end());
    ENSURE(v == val.end());
}
void Mix_Table :: to_coo ( View_Mat row , View_Mat col , View_Frac val ) const { REQUIRE ( row . size ( ) == num_elements ( ) ) ; REQUIRE ( col . size ( ) == num_elements ( ) ) ; REQUIRE ( val . size ( ) == num_elements ( ) ) ; auto r = row . begin ( ) ; auto c = col . begin ( ) ; auto v = val . begin ( ) ; for ( auto row_index : profugus :: range ( d_table . num_rows ( ) ) ) { auto view = d_table . row ( row_index ) ; for ( const Matid_Frac & kv : view ) { * r ++ = row_index ; * c ++ = kv . first ; * v ++ = kv . second ; } } ENSURE ( r == row . end ( ) ) ; ENSURE ( c == col . end ( ) ) ; ENSURE ( v == val . end ( ) ) ; }
\brief Get the COO representation of this table.
\ brief Get the COO representation of this table .