#include "mtl/mtl.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
using namespace mtl;
using namespace std;
//begin
typedef external_vec<float> Vec;
//end
/*
Sample Output
[5,-3,-4,6,0,]
Largest element in the vector x is at location 3
*/
int
main()
{
//begin
const int N = 5;
float dx[] = { 5.0, -3.0,-4.0, 6.0 , 0.0 };
Vec x(dx, N);
int imax = max_index(x);
//end
print_vector(x);
cout << "Largest element in the vector x is at location "
<< imax << endl;
return 0;
}
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
using namespace mtl;
using namespace std;
//begin
typedef external_vec<float> Vec;
//end
/*
Sample Output
[5,-3,-4,6,0,]
Largest element in the vector x is at location 3
*/
int
main()
{
//begin
const int N = 5;
float dx[] = { 5.0, -3.0,-4.0, 6.0 , 0.0 };
Vec x(dx, N);
int imax = max_index(x);
//end
print_vector(x);
cout << "Largest element in the vector x is at location "
<< imax << endl;
return 0;
}