COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
csc.h
Go to the documentation of this file.
1/****************************************************************/
2/* Parallel Combinatorial BLAS Library (for Graph Computations) */
3/* version 1.6 -------------------------------------------------*/
4/* date: 11/15/2016 --------------------------------------------*/
5/* authors: Ariful Azad, Aydin Buluc, Adam Lugowski ------------*/
6/****************************************************************/
7/*
8 Copyright (c) 2010-2016, The Regents of the University of California
9
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 THE SOFTWARE.
27 */
28
29
30#ifndef _CSC_H
31#define _CSC_H
32
33#include <cstdlib>
34#include <vector>
35#include <limits>
36#include <cassert>
37#include "SpDefs.h"
38#include "SpHelper.h"
39
40namespace combblas {
41
42template <class IT, class NT>
43class Csc
44{
45public:
46 typedef NT value_type;
47 typedef IT index_type;
48 Csc ();
49 Csc (IT size,IT nCol);
50 Csc (const Csc<IT,NT> & rhs); // copy constructor
51 ~Csc();
52
53 Csc<IT,NT> & operator=(const Csc<IT,NT> & rhs); // assignment operator
54 void Resize(IT nsize);
55
56 // index-based pruning
57 template <typename UnaryOperation,
58 typename GlobalIT>
61 GlobalIT rowOffset, GlobalIT colOffset);
62
63 void
65
66 void
67 Merge(const Csc<IT, NT> *A, const Csc<IT, NT> *B, IT cut);
68
69
70 IT * jc ; // col pointers, size n+1
71 IT * ir ; // row indices, size nzmax
72 NT * num; // generic values, size nzmax
73 IT n; // number of columns
75};
76
77}
78
79#include "csc.cpp" // Template member function definitions need to be known to the compiler
80
81#endif
int64_t IT
double NT
Definition test.cpp:53
void Merge(const Csc< IT, NT > *A, const Csc< IT, NT > *B, IT cut)
Definition csc.cpp:250
IT * jc
Definition csc.h:70
Csc< IT, NT > * PruneI(UnaryOperation unary_op, bool inPlace, GlobalIT rowOffset, GlobalIT colOffset)
Definition csc.cpp:147
Csc< IT, NT > & operator=(const Csc< IT, NT > &rhs)
Definition csc.cpp:67
NT value_type
Definition csc.h:46
IT index_type
Definition csc.h:47
void Resize(IT nsize)
Does not change the dimension.
Definition csc.cpp:107
void Split(Csc< IT, NT > *&A, Csc< IT, NT > *&B, IT cut)
Definition csc.cpp:216
IT * ir
Definition csc.h:71
NT * num
Definition csc.h:72
int size
Definition common.h:20
double A