示例#1
0
        // output specific to the storage layout of this type of matrix
        void print_info(std::ostream &os) const
        {
            os << "CscMatrix<" << typeid(ScalarT).name() << ">" << std::endl;
            os << "dimension: " << m_num_rows << " x " << m_num_cols
               << std::endl;
            os << "num nonzeros = " << get_nnz() << std::endl;
            os << "structural zero value = " << get_zero() << std::endl;

            os << "row_ind: ";
            for (auto ja: m_row_ind) {
                os << ja << " ";
            }
            os << std::endl;

            os << "col_ptr: ";
            for (auto ia: m_col_ptr) {
                os << ia << " ";
            }
            os << std::endl;

            os << "val: ";
            for (auto a: m_val) {
                os << a << " ";
            }
            os << std::endl;
        }
示例#2
0
文件: Topology.c 项目: zmr961006/DSAA
void Topsort(AdjList *G,int *indegree){
    
    int i,j,k;
    get_in_degree(G,indegree);
    for(i = 1;i <= G->vexnum;i++){
        k = get_zero(G,indegree);
        if(k != -1){
            printf("%d \n",k);
            set_sub(G,indegree,k);
        }
    }


}