Autoware.Auto
csc_matrix_conv.hpp
Go to the documentation of this file.
1 // Copyright 2021 The Autoware Foundation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef OSQP_INTERFACE__CSC_MATRIX_CONV_HPP_
16 #define OSQP_INTERFACE__CSC_MATRIX_CONV_HPP_
17 
18 #include <vector>
19 
20 #include "eigen3/Eigen/Core"
21 #include "osqp/glob_opts.h" // for 'c_int' type ('long' or 'long long')
23 
24 namespace autoware
25 {
26 namespace common
27 {
28 namespace osqp
29 {
31 struct OSQP_INTERFACE_PUBLIC CSC_Matrix
32 {
34  std::vector<c_float> m_vals;
36  std::vector<c_int> m_row_idxs;
38  std::vector<c_int> m_col_idxs;
39 };
40 
42 OSQP_INTERFACE_PUBLIC CSC_Matrix calCSCMatrix(const Eigen::MatrixXd & mat);
44 OSQP_INTERFACE_PUBLIC CSC_Matrix calCSCMatrixTrapezoidal(const Eigen::MatrixXd & mat);
46 OSQP_INTERFACE_PUBLIC void printCSCMatrix(const CSC_Matrix & csc_mat);
47 
48 } // namespace osqp
49 } // namespace common
50 } // namespace autoware
51 
52 #endif // OSQP_INTERFACE__CSC_MATRIX_CONV_HPP_
visibility_control.hpp
autoware::common::osqp::calCSCMatrixTrapezoidal
OSQP_INTERFACE_PUBLIC CSC_Matrix calCSCMatrixTrapezoidal(const Eigen::MatrixXd &mat)
Calculate upper trapezoidal CSC matrix from square Eigen matrix.
Definition: csc_matrix_conv.cpp:70
autoware::common::osqp::printCSCMatrix
OSQP_INTERFACE_PUBLIC void printCSCMatrix(const CSC_Matrix &csc_mat)
Print the given CSC matrix to the standard output.
Definition: csc_matrix_conv.cpp:117
autoware::common::osqp::CSC_Matrix::m_vals
std::vector< c_float > m_vals
Vector of non-zero values. Ex: [4,1,1,2].
Definition: csc_matrix_conv.hpp:34
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::common::osqp::CSC_Matrix::m_row_idxs
std::vector< c_int > m_row_idxs
Vector of row index corresponding to values. Ex: [0, 1, 0, 1] (Eigen: 'inner')
Definition: csc_matrix_conv.hpp:36
autoware::common::osqp::CSC_Matrix
Compressed-Column-Sparse Matrix.
Definition: csc_matrix_conv.hpp:31
autoware::common::osqp::CSC_Matrix::m_col_idxs
std::vector< c_int > m_col_idxs
Vector of 'val' indices where each column starts. Ex: [0, 2, 4] (Eigen: 'outer')
Definition: csc_matrix_conv.hpp:38
autoware::common::osqp::calCSCMatrix
OSQP_INTERFACE_PUBLIC CSC_Matrix calCSCMatrix(const Eigen::MatrixXd &mat)
Calculate CSC matrix from Eigen matrix.
Definition: csc_matrix_conv.cpp:29