Example for an algorithm

Hi everybody,

i have an algorithm which need as an input lattice basis b_1,...,b_2 ]in Z. The programm starts with

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;
// determine dimension n = Number of vectors
const int n =3;
// dimension of vectors b, determine element R^d
const int d = 3;
// declare matrix, vectors level
int sa_matrix[d][n];

My question is: How can i define a matrix

2 4
3 5

Is it n=2, d=2,4,3,5 ?

Hope someone can help me please.

best regards
tundrablume
closed account (DGvMDjzh)
I'm not sure what you mean. You defined a 3D array aka matrix with 3 of x and 3 of y.

To define the matrix you asked for you do:

1
2
3
4
5
int sa_matrix[2][2];
sa_matrix[1][1] = 2;
sa_matrix[1][2] = 3;
sa_matrix[2][1] = 4;
sa_matrix[2][2] = 5;


Did I answer your question?
Last edited on
Topic archived. No new replies allowed.