Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
model::StarsAndBars< N, k, j > Struct Template Reference

#include <StarsAndBars.h>

Collaboration diagram for model::StarsAndBars< N, k, j >:

Static Public Member Functions

static Eigen::Matrix< int, r1+r2, N > sAb ()

Static Public Attributes

static constexpr int r1 =CombinationWithRepetition<N,k-j-1>::value
static constexpr int r2 =CombinationWithRepetition<N-1,k-j>::value

Detailed Description

template<int N, int k, int j = 0>
struct model::StarsAndBars< N, k, j >

Class template that computes the possible sets of N integers whose sum is a given integer k. This is the solution of the Diophantine equation \(x_1+\ldots + x_N=k\).

Definition at line 23 of file StarsAndBars.h.

Member Function Documentation

◆ sAb()

template<int N, int k, int j = 0>
Eigen::Matrix< int, r1+r2, N > model::StarsAndBars< N, k, j >::sAb ( )
inlinestatic
Parameters
[in]poola row vector of N values
Returns
a matrix having in each row one of the combinatins of integers whose sum is k

Definition at line 36 of file StarsAndBars.h.

Member Data Documentation

◆ r1

template<int N, int k, int j = 0>
int model::StarsAndBars< N, k, j >::r1 =CombinationWithRepetition<N,k-j-1>::value
staticconstexpr

Definition at line 33 of file StarsAndBars.h.

◆ r2

template<int N, int k, int j = 0>
int model::StarsAndBars< N, k, j >::r2 =CombinationWithRepetition<N-1,k-j>::value
staticconstexpr

Definition at line 34 of file StarsAndBars.h.


The documentation for this struct was generated from the following file: