I have forgotten

COST (GBP)
0.62
0.00
0

# ASM Triangle Row

Returns a row of the alternating sign matrix triangle.
Controller: CodeCogs

C++

## Asm Triangle Row

 std::vectorasm_triangle_row( int n )
For a given n, the value of $\inline&space;&space;A(j)$ represents entry $\inline&space;&space;A(i,&space;j)$ of the triangular matrix, and gives the number of alternating sign matrices of order n in which the (unique) 1 in row i occurs in column j.

For example, of alternating sign matrices of order 3, there are 2 with a leading 1 in column 1:
$\left(&space;\begin{array}{ccc}&space;1&space;&&space;0&space;&&space;0&space;\cr&space;0&space;&&space;1&space;&&space;0&space;\cr&space;0&space;&&space;0&space;&&space;1&space;\end{array}&space;\right)&space;\qquad&space;\left(&space;\begin{array}{ccc}&space;1&space;&&space;0&space;&&space;0&space;\cr&space;0&space;&&space;0&space;&&space;1&space;\cr&space;0&space;&&space;1&space;&&space;0&space;\end{array}&space;\right)$
3 with a leading 1 in column 2:
$\left(&space;\begin{array}{ccc}&space;0&space;&&space;1&space;&&space;0&space;\cr&space;1&space;&&space;0&space;&&space;0&space;\cr&space;0&space;&&space;0&space;&&space;1&space;\end{array}&space;\right)&space;\qquad&space;\left(&space;\begin{array}{ccc}&space;0&space;&&space;1&space;&&space;0&space;\cr&space;0&space;&&space;0&space;&&space;1&space;\cr&space;1&space;&&space;0&space;&&space;0&space;\end{array}&space;\right)&space;\qquad&space;\left(&space;\begin{array}{ccc}&space;0&space;&&space;1&space;&&space;0&space;\cr&space;1&space;&&space;-1&space;&&space;1&space;\cr&space;0&space;&&space;1&space;&&space;0&space;\end{array}&space;\right)$
and 2 with a leading 1 in column 3:
$\left(&space;\begin{array}{ccc}&space;0&space;&&space;0&space;&&space;1&space;\cr&space;1&space;&&space;0&space;&&space;0&space;\cr&space;0&space;&&space;1&space;&&space;0&space;\end{array}&space;\right)&space;\qquad&space;\left(&space;\begin{array}{ccc}&space;0&space;&&space;0&space;&&space;1&space;\cr&space;0&space;&&space;1&space;&&space;0&space;\cr&space;1&space;&&space;0&space;&&space;0&space;\end{array}&space;\right)$

## References:

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

### Example 1

#include <codecogs/maths/combinatorics/sequences/asm_triangle_row.h>
#include <iostream>
int main()
{
std::vector<int> result = Maths::Combinatorics::Sequences::asm_triangle_row(4);
std::cout << "Size of row: " << result.size() << std::endl;
for (int j = 0; j < result.size(); j++)
std::cout << result[j] << "  ";
std::cout << std::endl;

return 0;
}
Output:
Size of row: 5
42  105  135  105  42

### Returns

the entries of the row

### Authors

Lucian Bentea (August 2005)
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.