ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Inverse.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
11 
12 namespace cloudViewer {
13 namespace core {
14 
16 void Inverse(const Tensor& A, Tensor& output);
17 
18 void InverseCPU(void* A_data,
19  void* ipiv_data,
20  [[maybe_unused]] void* output_data,
21  int64_t n,
22  Dtype dtype,
23  const Device& device);
24 
25 #ifdef BUILD_SYCL_MODULE
26 void InverseSYCL(void* A_data,
27  void* ipiv_data,
28  [[maybe_unused]] void* output_data,
29  int64_t n,
30  Dtype dtype,
31  const Device& device);
32 #endif
33 
34 #ifdef BUILD_CUDA_MODULE
35 void InverseCUDA(void* A_data,
36  void* ipiv_data,
37  void* output_data,
38  int64_t n,
39  Dtype dtype,
40  const Device& device);
41 #endif
42 
43 } // namespace core
44 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::core::Tensor::GetDtype
Dtype GetDtype() const
Definition: Tensor.h:1164
CUDAUtils.h
Common CUDA utilities.
cloudViewer::core::Tensor::GetShape
SizeVector GetShape() const
Definition: Tensor.h:1127
cloudViewer::core::Tensor::Contiguous
Tensor Contiguous() const
Definition: Tensor.cpp:772
Inverse.h
cloudViewer::core::Tensor
Definition: Tensor.h:32
cloudViewer::core::Dtype
Definition: Dtype.h:21
cloudViewer::core::Tensor::Eye
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Definition: Tensor.cpp:418
cloudViewer::core::Tensor::Zeros
static Tensor Zeros(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor fill with zeros.
Definition: Tensor.cpp:406
cloudViewer::core::Int32
const Dtype Int32
Definition: Dtype.cpp:46
cloudViewer::core::Tensor::T
Tensor T() const
Expects input to be <= 2-D Tensor by swapping dimension 0 and 1.
Definition: Tensor.cpp:1079
cloudViewer::core::Device
Definition: Device.h:18
core
cloudViewer::core::Float64
const Dtype Float64
Definition: Dtype.cpp:43
cloudViewer::core::InverseSYCL
void InverseSYCL(void *A_data, void *ipiv_data, void *output_data, int64_t n, Dtype dtype, const Device &device)
Definition: InverseSYCL.cpp:19
cloudViewer::core::Inverse
void Inverse(const Tensor &A, Tensor &output)
Computes A^{-1} with LU factorization, where A is a N x N square matrix.
Definition: Inverse.cpp:18
cloudViewer::core::Tensor::GetDevice
Device GetDevice() const override
Definition: Tensor.cpp:1435
cloudViewer::core::CUDAScopedDevice
When CUDA is not enabled, this is a dummy class.
Definition: CUDAUtils.h:214
cloudViewer::core::Float32
const Dtype Float32
Definition: Dtype.cpp:42
cloudViewer::core::SizeVector
Definition: SizeVector.h:70
CLOUDVIEWER_CPU_LINALG_INT
#define CLOUDVIEWER_CPU_LINALG_INT
Definition: LinalgHeadersCPU.h:23
LogError
#define LogError(...)
Definition: Logging.h:60
cloudViewer::core::Tensor::Empty
static Tensor Empty(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor with uninitialized values.
Definition: Tensor.cpp:400
Tensor.h
LinalgHeadersCPU.h
cloudViewer::core::InverseCUDA
void InverseCUDA(void *A_data, void *ipiv_data, void *output_data, int64_t n, Dtype dtype, const Device &device)
Definition: InverseCUDA.cpp:16
AssertTensorDtypes
#define AssertTensorDtypes(tensor,...)
Definition: TensorCheck.h:33
cloudViewer::core::Int64
const Dtype Int64
Definition: Dtype.cpp:47
cloudViewer::core::Tensor::To
Tensor To(Dtype dtype, bool copy=false) const
Definition: Tensor.cpp:739
cloudViewer::core::InverseCPU
void InverseCPU(void *A_data, void *ipiv_data, [[maybe_unused]] void *output_data, int64_t n, Dtype dtype, const Device &device)
cloudViewer::core::Tensor::GetDataPtr
T * GetDataPtr()
Definition: Tensor.h:1144