libeigen/eigen!2509 Closes #2868 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
8 lines
320 B
C++
8 lines
320 B
C++
// SPDX-FileCopyrightText: The Eigen Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
Vector3d v(-1, 2, -3);
|
|
cout << "the absolute values:" << endl << v.array().abs() << endl;
|
|
cout << "the absolute values plus one:" << endl << v.array().abs() + 1 << endl;
|
|
cout << "sum of the squares: " << v.array().square().sum() << endl;
|