Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Zoltan2_MatrixAdapter.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Zoltan2: A package of combinatorial algorithms for scientific computing
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Karen Devine (kddevin@sandia.gov)
39 // Erik Boman (egboman@sandia.gov)
40 // Siva Rajamanickam (srajama@sandia.gov)
41 //
42 // ***********************************************************************
43 //
44 // @HEADER
45 
50 #ifndef _ZOLTAN2_MATRIXADAPTER_HPP_
51 #define _ZOLTAN2_MATRIXADAPTER_HPP_
52 
53 #include <Zoltan2_Adapter.hpp>
55 
56 namespace Zoltan2 {
57 
62 };
63 
105 template <typename User, typename UserCoord=User>
106  class MatrixAdapter : public AdapterWithCoordsWrapper<User, UserCoord> {
107 private:
108  enum MatrixEntityType primaryEntityType_;
109  VectorAdapter<UserCoord> *coordinateInput_;
110  bool haveCoordinateInput_;
111 
112 public:
113 
114 #ifndef DOXYGEN_SHOULD_SKIP_THIS
115  using scalar_t = typename InputTraits<User>::scalar_t;
116  using lno_t = typename InputTraits<User>::lno_t;
117  using gno_t = typename InputTraits<User>::gno_t;
118  using part_t = typename InputTraits<User>::part_t;
119  using node_t = typename InputTraits<User>::node_t;
120  using offset_t = typename InputTraits<User>::offset_t;
121  using user_t = User;
122  using userCoord_t = UserCoord;
124  using device_t = typename node_t::device_type;
125 #endif
126 
127  enum BaseAdapterType adapterType() const override {return MatrixAdapterType;}
128 
129  // Constructor; sets default primaryEntityType to MATRIX_ROW.
130  MatrixAdapter() : primaryEntityType_(MATRIX_ROW),
131  coordinateInput_(),
132  haveCoordinateInput_(false) {}
133 
136  virtual size_t getLocalNumRows() const = 0;
137 
140  virtual size_t getLocalNumColumns() const = 0;
141 
144  virtual size_t getLocalNumEntries() const = 0;
145 
146 
147 
153  virtual bool CRSViewAvailable() const { return false; }
154 
158  virtual void getRowIDsView(const gno_t *&rowIds) const
159  {
160  rowIds = NULL;
162  }
163 
164  virtual void getRowIDsHostView(typename BaseAdapter<User>::ConstIdsHostView& rowIds) const
165  {
167  }
168 
169  virtual void getRowIDsDeviceView(typename BaseAdapter<User>::ConstIdsDeviceView& rowIds) const
170  {
172  }
173 
185  virtual void getCRSView(ArrayRCP<const offset_t> &offsets, ArrayRCP<const gno_t> &colIds) const
186  {
187  // Default implementation; no CRS view provided.
188  offsets = ArrayRCP<const offset_t>();
189  colIds = ArrayRCP<const gno_t>();
191  }
192 
194  typename BaseAdapter<User>::ConstIdsHostView& colIds) const
195  {
197  }
198 
200  typename BaseAdapter<User>::ConstIdsDeviceView& colIds) const
201  {
203  }
204 
205 
220  virtual void getCRSView(ArrayRCP<const offset_t> &offsets,
221  ArrayRCP<const gno_t> &colIds,
222  ArrayRCP<const scalar_t> &values) const
223  {
224  // Default implementation; no CRS view provided.
225  offsets = ArrayRCP<const offset_t>();
226  colIds = ArrayRCP<const gno_t>();
227  values = ArrayRCP<const scalar_t>();
229  }
230 
232  typename BaseAdapter<User>::ConstIdsHostView& colIds,
233  typename BaseAdapter<User>::ConstScalarsHostView& values) const
234  {
236  }
237 
239  typename BaseAdapter<User>::ConstIdsDeviceView& colIds,
240  typename BaseAdapter<User>::ConstScalarsDeviceView& values) const
241  {
243  }
244 
245 
249  virtual int getNumWeightsPerRow() const { return 0;}
250 
257  virtual void getRowWeightsView(const scalar_t *&weights, int &stride,
258  int idx = 0) const
259  {
260  // Default implementation
261  weights = NULL;
262  stride = 0;
264  }
265 
267  int /* idx */ = 0) const {
269  }
270 
273  }
274 
276  int /* idx */ = 0) const {
278  }
279 
282  }
283 
287  virtual bool useNumNonzerosAsRowWeight(int idx) const
288  {
290  }
291 
297  virtual bool CCSViewAvailable() const { return false; }
298 
302  virtual void getColumnIDsView(const gno_t *&colIds) const
303  {
304  colIds = NULL;
306  }
307 
308  virtual void getColumnIDsHostView(typename BaseAdapter<User>::ConstIdsHostView& colIds) const
309  {
311  }
312 
314  {
316  }
317 
329  virtual void getCCSView(ArrayRCP<const offset_t> &offsets,
330  ArrayRCP<const gno_t> &rowIds) const
331  {
332  // Default implementation; no CCS view provided.
333  offsets = ArrayRCP<const offset_t>();
334  rowIds = ArrayRCP<const gno_t>();
336  }
337 
352  virtual void getCCSView(ArrayRCP<const offset_t> &offsets,
353  ArrayRCP<const gno_t> &rowIds,
354  ArrayRCP<const scalar_t> &values) const
355  {
356  // Default implementation; no CCS view provided.
357  offsets = ArrayRCP<const offset_t>();
358  rowIds = ArrayRCP<const gno_t>();
359  values = ArrayRCP<const scalar_t>();
361  }
362 
366  virtual int getNumWeightsPerColumn() const { return 0; }
367 
374  virtual void getColumnWeightsView(const scalar_t *&weights, int &stride,
375  int idx = 0) const
376  {
377  // Default implementation
378  weights = NULL;
379  stride = 0;
381  }
382 
384  int /* idx */ = 0) const {
386  }
387 
390  }
391 
393  int /* idx */ = 0) const {
395  }
396 
399  }
400 
404  virtual bool useNumNonzerosAsColumnWeight(int idx) const { return 0; }
405 
406 #ifdef FUTURE_FEATURE
407 
411  virtual bool symmetricStorage() const {return false;}
412 #endif
413 
423  {
424  coordinateInput_ = coordData;
425  haveCoordinateInput_ = true;
426  }
427 
431  bool coordinatesAvailable() const { return haveCoordinateInput_; }
432 
437  {
438  return coordinateInput_;
439  }
440 
442  // Implementations of base-class methods and other methods shared by all
443 
448  {
449  return this->primaryEntityType_;
450  }
451 
457  void setPrimaryEntityType(std::string typestr)
458  {
459  if (typestr == "row") {
460  this->primaryEntityType = MATRIX_ROW;
461  }
462  else if (typestr == "column") {
463  this->primaryEntityType = MATRIX_COLUMN;
464  }
465  else if (typestr == "nonzero") {
466  this->primaryEntityType = MATRIX_NONZERO;
467  }
468  else {
469  std::ostringstream emsg;
470  emsg << __FILE__ << "," << __LINE__
471  << " error: Invalid MatrixEntityType " << typestr << std::endl;
472  emsg << "Valid values are 'row', 'column' and 'nonzero'." << std::endl;
473  throw std::runtime_error(emsg.str());
474  }
475  }
476 
477  // Functions from the BaseAdapter interface
478  size_t getLocalNumIDs() const override
479  {
480  switch (getPrimaryEntityType()) {
481  case MATRIX_ROW:
482  return getLocalNumRows();
483  case MATRIX_COLUMN:
484  return getLocalNumColumns();
485  case MATRIX_NONZERO:
486  return getLocalNumEntries();
487  default: // Shouldn't reach default; just making compiler happy
488  return 0;
489  }
490  }
491 
492  void getIDsView(const gno_t *&Ids) const override
493  {
494  switch (getPrimaryEntityType()) {
495  case MATRIX_ROW:
496  getRowIDsView(Ids);
497  break;
498  case MATRIX_COLUMN:
499  getColumnIDsView(Ids);
500  break;
501  case MATRIX_NONZERO: {
502  // TODO: Need getNonzeroIDsView? What is a Nonzero ID?
503  // TODO: std::pair<gno_t, gno_t>?
504  std::ostringstream emsg;
505  emsg << __FILE__ << "," << __LINE__
506  << " error: getIDsView not yet supported for matrix nonzeros."
507  << std::endl;
508  throw std::runtime_error(emsg.str());
509  }
510  default: // Shouldn't reach default; just making compiler happy
511  break;
512  }
513  }
514 
515  void getIDsHostView(typename BaseAdapter<User>::ConstIdsHostView& ids) const override {
516  switch (getPrimaryEntityType()) {
517  case MATRIX_ROW:
518  getRowIDsHostView(ids);
519  break;
520  case MATRIX_COLUMN:
522  break;
523  case MATRIX_NONZERO: {
524  // TODO: Need getNonzeroIDsHostView? What is a Nonzero ID?
525  // TODO: std::pair<gno_t, gno_t>?
526  std::ostringstream emsg;
527  emsg << __FILE__ << "," << __LINE__
528  << " error: getIDsView not yet supported for matrix nonzeros."
529  << std::endl;
530  throw std::runtime_error(emsg.str());
531  }
532  default: // Shouldn't reach default; just making compiler happy
533  break;
534  }
535  }
536 
537  void getIDsDeviceView(typename BaseAdapter<User>::ConstIdsDeviceView& ids) const override {
538  switch (getPrimaryEntityType()) {
539  case MATRIX_ROW:
540  getRowIDsDeviceView(ids);
541  break;
542  case MATRIX_COLUMN:
544  break;
545  case MATRIX_NONZERO: {
546  // TODO: Need getNonzeroIDsDeviceView? What is a Nonzero ID?
547  // TODO: std::pair<gno_t, gno_t>?
548  std::ostringstream emsg;
549  emsg << __FILE__ << "," << __LINE__
550  << " error: getIDsView not yet supported for matrix nonzeros."
551  << std::endl;
552  throw std::runtime_error(emsg.str());
553  }
554  default: // Shouldn't reach default; just making compiler happy
555  break;
556  }
557  }
558 
559  int getNumWeightsPerID() const override
560  {
561  switch (getPrimaryEntityType()) {
562  case MATRIX_ROW:
563  return getNumWeightsPerRow();
564  case MATRIX_COLUMN:
565  return getNumWeightsPerColumn();
566  case MATRIX_NONZERO:
567  return 0; //TODO: weights not yet supported for nonzeros
568  default: // Shouldn't reach default; just making compiler happy
569  return 0;
570  }
571  }
572 
573  void getWeightsView(const scalar_t *&wgt, int &stride,
574  int idx = 0) const override
575  {
576  switch (getPrimaryEntityType()) {
577  case MATRIX_ROW:
578  getRowWeightsView(wgt, stride, idx);
579  break;
580  case MATRIX_COLUMN:
581  getColumnWeightsView(wgt, stride, idx);
582  break;
583  case MATRIX_NONZERO:
584  {
585  // TODO: Need getNonzeroWeightsView with Nonzeros as primary object?
586  // TODO: That is, get Nonzeros' weights based on some nonzero ID?
587  std::ostringstream emsg;
588  emsg << __FILE__ << "," << __LINE__
589  << " error: getWeightsView not yet supported for matrix nonzeros."
590  << std::endl;
591  throw std::runtime_error(emsg.str());
592  }
593  default: // Shouldn't reach default; just making compiler happy
594  break;
595  }
596  }
597 
598  void getWeightsHostView(typename BaseAdapter<User>::WeightsHostView &hostWgts) const override {
599  switch (getPrimaryEntityType()) {
600  case MATRIX_ROW:
601  getRowWeightsHostView(hostWgts);
602  break;
603  case MATRIX_COLUMN:
604  getColumnWeightsHostView(hostWgts);
605  break;
606  case MATRIX_NONZERO:
607  {
608  // TODO: Need getNonzeroWeightsView with Nonzeros as primary object?
609  // TODO: That is, get Nonzeros' weights based on some nonzero ID?
610  std::ostringstream emsg;
611  emsg << __FILE__ << "," << __LINE__
612  << " error: getWeightsView not yet supported for matrix nonzeros."
613  << std::endl;
614  throw std::runtime_error(emsg.str());
615  }
616  default: // Shouldn't reach default; just making compiler happy
617  break;
618  } }
619 
621  int idx = 0) const override {
622  switch (getPrimaryEntityType()) {
623  case MATRIX_ROW:
624  getRowWeightsHostView(hostWgts, idx);
625  break;
626  case MATRIX_COLUMN:
627  getColumnWeightsHostView(hostWgts, idx);
628  break;
629  case MATRIX_NONZERO:
630  {
631  // TODO: Need getNonzeroWeightsView with Nonzeros as primary object?
632  // TODO: That is, get Nonzeros' weights based on some nonzero ID?
633  std::ostringstream emsg;
634  emsg << __FILE__ << "," << __LINE__
635  << " error: getWeightsView not yet supported for matrix nonzeros."
636  << std::endl;
637  throw std::runtime_error(emsg.str());
638  }
639  default: // Shouldn't reach default; just making compiler happy
640  break;
641  } }
642 
643  void getWeightsDeviceView(typename BaseAdapter<User>::WeightsDeviceView& deviceWgts) const override {
644  switch (getPrimaryEntityType()) {
645  case MATRIX_ROW:
646  getRowWeightsDeviceView(deviceWgts);
647  break;
648  case MATRIX_COLUMN:
649  getColumnWeightsDeviceView(deviceWgts);
650  break;
651  case MATRIX_NONZERO:
652  {
653  // TODO: Need getNonzeroWeightsView with Nonzeros as primary object?
654  // TODO: That is, get Nonzeros' weights based on some nonzero ID?
655  std::ostringstream emsg;
656  emsg << __FILE__ << "," << __LINE__
657  << " error: getWeightsView not yet supported for matrix nonzeros."
658  << std::endl;
659  throw std::runtime_error(emsg.str());
660  }
661  default: // Shouldn't reach default; just making compiler happy
662  break;
663  } }
664 
666  int idx = 0) const override {
667  switch (getPrimaryEntityType()) {
668  case MATRIX_ROW:
669  getRowWeightsDeviceView(deviceWgts, idx);
670  break;
671  case MATRIX_COLUMN:
672  getColumnWeightsDeviceView(deviceWgts, idx);
673  break;
674  case MATRIX_NONZERO:
675  {
676  // TODO: Need getNonzeroWeightsView with Nonzeros as primary object?
677  // TODO: That is, get Nonzeros' weights based on some nonzero ID?
678  std::ostringstream emsg;
679  emsg << __FILE__ << "," << __LINE__
680  << " error: getWeightsView not yet supported for matrix nonzeros."
681  << std::endl;
682  throw std::runtime_error(emsg.str());
683  }
684  default: // Shouldn't reach default; just making compiler happy
685  break;
686  } }
687 
688  bool useDegreeAsWeight(int idx) const
689  {
690  if (this->getPrimaryEntityType() == MATRIX_ROW)
691  return useNumNonzerosAsRowWeight(idx);
692  else {
693  std::ostringstream emsg;
694  emsg << __FILE__ << "," << __LINE__
695  << " error: useDegreeAsWeight is currently supported only for rows"
696  << std::endl;
697  throw std::runtime_error(emsg.str());
698  }
699  }
700 };
701 
702 } //namespace Zoltan2
703 
704 #endif
Zoltan2::BaseAdapter< userTypes_t > base_adapter_t
VectorAdapter< UserCoord > * getCoordinateInput() const override
Obtain the coordinate data registered by the user.
size_t getLocalNumIDs() const override
Returns the number of objects on this process.
void setPrimaryEntityType(std::string typestr)
Sets the primary entity type. Called by algorithm based on parameter value in parameter list from app...
virtual void getCCSView(ArrayRCP< const offset_t > &offsets, ArrayRCP< const gno_t > &rowIds) const
Sets pointers to this process&#39; matrix entries using compressed sparse column (CCS) format...
virtual void getRowIDsDeviceView(typename BaseAdapter< User >::ConstIdsDeviceView &rowIds) const
typename InputTraits< User >::scalar_t scalar_t
MatrixAdapter defines the adapter interface for matrices.
static ArrayRCP< ArrayRCP< zscalar_t > > weights
Kokkos::View< scalar_t *, device_t > WeightsDeviceView1D
virtual bool useNumNonzerosAsColumnWeight(int idx) const
Indicate whether column weight with index idx should be the global number of nonzeros in the column...
void getWeightsHostView(typename BaseAdapter< User >::WeightsHostView1D &hostWgts, int idx=0) const override
virtual void getColumnWeightsDeviceView(typename BaseAdapter< User >::WeightsDeviceView &weights) const
bool coordinatesAvailable() const
Indicate whether coordinate information has been set for this MatrixAdapter.
default_part_t part_t
The data type to represent part numbers.
default_offset_t offset_t
The data type to represent offsets.
virtual int getNumWeightsPerColumn() const
Returns the number of weights per column (0 or greater). Column weights may be used when partitioning...
Defines the VectorAdapter interface.
enum MatrixEntityType getPrimaryEntityType() const
Returns the entity to be partitioned, ordered, colored, etc. Valid values are MATRIX_ROW, MATRIX_COLUMN, MATRIX_NONZERO.
virtual void getRowWeightsView(const scalar_t *&weights, int &stride, int idx=0) const
Provide a pointer to the row weights, if any.
#define Z2_THROW_NOT_IMPLEMENTED
virtual void getCRSDeviceView(typename BaseAdapter< User >::ConstOffsetsDeviceView &offsets, typename BaseAdapter< User >::ConstIdsDeviceView &colIds, typename BaseAdapter< User >::ConstScalarsDeviceView &values) const
typename node_t::device_type device_t
typename InputTraits< User >::part_t part_t
Kokkos::View< const gno_t *, device_t > ConstIdsDeviceView
void getWeightsDeviceView(typename BaseAdapter< User >::WeightsDeviceView &deviceWgts) const override
typename ConstScalarsDeviceView::HostMirror ConstScalarsHostView
void getIDsView(const gno_t *&Ids) const override
Provide a pointer to this process&#39; identifiers.
virtual void getRowWeightsDeviceView(typename BaseAdapter< User >::WeightsDeviceView1D &weights, int=0) const
virtual void getColumnIDsHostView(typename BaseAdapter< User >::ConstIdsHostView &colIds) const
virtual void getCRSHostView(typename BaseAdapter< User >::ConstOffsetsHostView &offsets, typename BaseAdapter< User >::ConstIdsHostView &colIds) const
typename WeightsDeviceView::HostMirror WeightsHostView
virtual size_t getLocalNumColumns() const =0
Returns the number of columns on this process.
virtual void getCRSView(ArrayRCP< const offset_t > &offsets, ArrayRCP< const gno_t > &colIds, ArrayRCP< const scalar_t > &values) const
Sets pointers to this process&#39; matrix entries and their values using compressed sparse row (CRS) form...
Kokkos::View< const scalar_t *, device_t > ConstScalarsDeviceView
void getIDsDeviceView(typename BaseAdapter< User >::ConstIdsDeviceView &ids) const override
typename InputTraits< User >::node_t node_t
typename ConstOffsetsDeviceView::HostMirror ConstOffsetsHostView
virtual bool useNumNonzerosAsRowWeight(int idx) const
Indicate whether row weight with index idx should be the global number of nonzeros in the row...
virtual void getRowIDsHostView(typename BaseAdapter< User >::ConstIdsHostView &rowIds) const
virtual bool CCSViewAvailable() const
Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse column (CCS)...
typename InputTraits< User >::gno_t gno_t
typename ConstIdsDeviceView::HostMirror ConstIdsHostView
virtual void getRowWeightsDeviceView(typename BaseAdapter< User >::WeightsDeviceView &weights) const
default_lno_t lno_t
The ordinal type (e.g., int, long, int64_t) that represents local counts and local indices...
BaseAdapterType
An enum to identify general types of adapters.
virtual void getRowWeightsHostView(typename BaseAdapter< User >::WeightsHostView &weights) const
virtual int getNumWeightsPerRow() const
Returns the number of weights per row (0 or greater). Row weights may be used when partitioning matri...
default_gno_t gno_t
The ordinal type (e.g., int, long, int64_t) that can represent global counts and identifiers.
enum BaseAdapterType adapterType() const override
Returns the type of adapter.
virtual void getColumnWeightsView(const scalar_t *&weights, int &stride, int idx=0) const
Provide a pointer to the column weights, if any.
default_node_t node_t
The Kokkos node type. This is only meaningful for users of Tpetra objects.
virtual void getRowWeightsHostView(typename BaseAdapter< User >::WeightsHostView1D &weights, int=0) const
virtual void getCRSHostView(typename BaseAdapter< User >::ConstOffsetsHostView &offsets, typename BaseAdapter< User >::ConstIdsHostView &colIds, typename BaseAdapter< User >::ConstScalarsHostView &values) const
void getIDsHostView(typename BaseAdapter< User >::ConstIdsHostView &ids) const override
typename InputTraits< User >::offset_t offset_t
typename WeightsDeviceView1D::HostMirror WeightsHostView1D
int getNumWeightsPerID() const override
Returns the number of weights per object. Number of weights per object should be zero or greater...
virtual void getColumnWeightsDeviceView(typename BaseAdapter< User >::WeightsDeviceView1D &weights, int=0) const
void getWeightsHostView(typename BaseAdapter< User >::WeightsHostView &hostWgts) const override
bool useDegreeAsWeight(int idx) const
Kokkos::View< scalar_t **, device_t > WeightsDeviceView
virtual void getCCSView(ArrayRCP< const offset_t > &offsets, ArrayRCP< const gno_t > &rowIds, ArrayRCP< const scalar_t > &values) const
Sets pointers to this process&#39; matrix entries and their values using compressed sparse column (CCS) f...
void setCoordinateInput(VectorAdapter< UserCoord > *coordData) override
Allow user to provide additional data that contains coordinate info associated with the MatrixAdapter...
virtual void getRowIDsView(const gno_t *&rowIds) const
Sets pointer to this process&#39; rows&#39; global IDs.
virtual bool CRSViewAvailable() const
Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse row (CRS) fo...
virtual void getCRSView(ArrayRCP< const offset_t > &offsets, ArrayRCP< const gno_t > &colIds) const
Sets pointers to this process&#39; matrix entries using compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
virtual size_t getLocalNumRows() const =0
Returns the number of rows on this process.
void getWeightsView(const scalar_t *&wgt, int &stride, int idx=0) const override
Provide pointer to a weight array with stride.
virtual void getColumnIDsDeviceView(typename BaseAdapter< User >::ConstIdsDeviceView &colIds) const
virtual size_t getLocalNumEntries() const =0
Returns the number of nonzeros on this process.
Kokkos::View< const offset_t *, device_t > ConstOffsetsDeviceView
virtual void getCRSDeviceView(typename BaseAdapter< User >::ConstOffsetsDeviceView &offsets, typename BaseAdapter< User >::ConstIdsDeviceView &colIds) const
void getWeightsDeviceView(typename BaseAdapter< User >::WeightsDeviceView1D &deviceWgts, int idx=0) const override
typename InputTraits< User >::lno_t lno_t
default_scalar_t scalar_t
The data type for weights and coordinates.
virtual void getColumnWeightsHostView(typename BaseAdapter< User >::WeightsHostView1D &weights, int=0) const
virtual void getColumnIDsView(const gno_t *&colIds) const
Sets pointer to this process&#39; columns&#39; global IDs.
virtual void getColumnWeightsHostView(typename BaseAdapter< User >::WeightsHostView &weights) const