OR-Tools  9.6
Sharder

Detailed Description

Definition at line 34 of file sharder.h.

Classes

class  Shard
 

Public Types

using ConstSparseColumnBlock = ::Eigen::Block< const Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t >, Eigen::Dynamic, Eigen::Dynamic, true >
 
using SparseColumnBlock = ::Eigen::Block< Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t >, Eigen::Dynamic, Eigen::Dynamic, true >
 

Public Member Functions

 Sharder (int64_t num_elements, int num_shards, ThreadPool *thread_pool, const std::function< int64_t(int64_t)> &element_mass)
 
 Sharder (int64_t num_elements, int num_shards, ThreadPool *thread_pool)
 
 Sharder (const Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t > &matrix, int num_shards, ThreadPool *thread_pool)
 
 Sharder (const Sharder &other_sharder, int64_t num_elements)
 
 Sharder (const Sharder &other)=default
 
 Sharder (Sharder &&other)=default
 
Sharderoperator= (const Sharder &other)=default
 
Sharderoperator= (Sharder &&other)=default
 
int NumShards () const
 
int64_t NumElements () const
 
int64_t ShardSize (int shard) const
 
int64_t ShardStart (int shard) const
 
int64_t ShardMass (int shard) const
 
void ParallelForEachShard (const std::function< void(const Shard &)> &func) const
 
double ParallelSumOverShards (const std::function< double(const Shard &)> &func) const
 
bool ParallelTrueForAllShards (const std::function< bool(const Shard &)> &func) const
 
const std::vector< int64_t > & ShardStartsForTesting () const
 

Member Typedef Documentation

◆ ConstSparseColumnBlock

using ConstSparseColumnBlock = ::Eigen::Block< const Eigen::SparseMatrix<double, Eigen::ColMajor, int64_t>, Eigen::Dynamic, Eigen::Dynamic, true>

Definition at line 38 of file sharder.h.

◆ SparseColumnBlock

using SparseColumnBlock = ::Eigen::Block<Eigen::SparseMatrix<double, Eigen::ColMajor, int64_t>, Eigen::Dynamic, Eigen::Dynamic, true>

Definition at line 42 of file sharder.h.

Constructor & Destructor Documentation

◆ Sharder() [1/6]

Sharder ( int64_t  num_elements,
int  num_shards,
ThreadPool thread_pool,
const std::function< int64_t(int64_t)> &  element_mass 
)

Definition at line 36 of file sharder.cc.

◆ Sharder() [2/6]

Sharder ( int64_t  num_elements,
int  num_shards,
ThreadPool thread_pool 
)

Definition at line 72 of file sharder.cc.

◆ Sharder() [3/6]

Sharder ( const Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t > &  matrix,
int  num_shards,
ThreadPool thread_pool 
)
inline

Definition at line 161 of file sharder.h.

◆ Sharder() [4/6]

Sharder ( const Sharder other_sharder,
int64_t  num_elements 
)

Definition at line 98 of file sharder.cc.

◆ Sharder() [5/6]

Sharder ( const Sharder other)
default

◆ Sharder() [6/6]

Sharder ( Sharder &&  other)
default

Member Function Documentation

◆ NumElements()

int64_t NumElements ( ) const
inline

Definition at line 184 of file sharder.h.

◆ NumShards()

int NumShards ( ) const
inline

Definition at line 181 of file sharder.h.

◆ operator=() [1/2]

Sharder& operator= ( const Sharder other)
default

◆ operator=() [2/2]

Sharder& operator= ( Sharder &&  other)
default

◆ ParallelForEachShard()

void ParallelForEachShard ( const std::function< void(const Shard &)> &  func) const

Definition at line 104 of file sharder.cc.

◆ ParallelSumOverShards()

double ParallelSumOverShards ( const std::function< double(const Shard &)> &  func) const

Definition at line 138 of file sharder.cc.

◆ ParallelTrueForAllShards()

bool ParallelTrueForAllShards ( const std::function< bool(const Shard &)> &  func) const

Definition at line 147 of file sharder.cc.

◆ ShardMass()

int64_t ShardMass ( int  shard) const
inline

Definition at line 198 of file sharder.h.

◆ ShardSize()

int64_t ShardSize ( int  shard) const
inline

Definition at line 186 of file sharder.h.

◆ ShardStart()

int64_t ShardStart ( int  shard) const
inline

Definition at line 192 of file sharder.h.

◆ ShardStartsForTesting()

const std::vector<int64_t>& ShardStartsForTesting ( ) const
inline

Definition at line 218 of file sharder.h.


The documentation for this class was generated from the following files: