ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
SVDCPU.cpp
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
#include "
cloudViewer/core/linalg/LapackWrapper.h
"
9
#include "
cloudViewer/core/linalg/LinalgUtils.h
"
10
#include "
cloudViewer/core/linalg/SVD.h
"
11
12
namespace
cloudViewer
{
13
namespace
core {
14
15
void
SVDCPU
(
const
void
* A_data,
16
void
* U_data,
17
void
* S_data,
18
void
* VT_data,
19
void
* superb_data,
20
int64_t m,
21
int64_t n,
22
Dtype
dtype,
23
const
Device
& device) {
24
DISPATCH_LINALG_DTYPE_TO_TEMPLATE
(dtype, [&]() {
25
OPEN3D_LAPACK_CHECK
(
26
gesvd_cpu<scalar_t>(
27
LAPACK_COL_MAJOR,
'A'
,
'A'
, m, n,
28
const_cast<
scalar_t*
>
(
29
static_cast<
const
scalar_t*
>
(A_data)),
30
m,
static_cast<
scalar_t*
>
(S_data),
31
static_cast<
scalar_t*
>
(U_data), m,
32
static_cast<
scalar_t*
>
(VT_data), n,
33
static_cast<
scalar_t*
>
(superb_data)),
34
"gesvd failed in SVDCPU"
);
35
});
36
}
37
38
}
// namespace core
39
}
// namespace cloudViewer
LapackWrapper.h
LinalgUtils.h
DISPATCH_LINALG_DTYPE_TO_TEMPLATE
#define DISPATCH_LINALG_DTYPE_TO_TEMPLATE(DTYPE,...)
Definition:
LinalgUtils.h:23
SVD.h
cloudViewer::core::Device
Definition:
Device.h:18
cloudViewer::core::Dtype
Definition:
Dtype.h:21
cloudViewer::core::OPEN3D_LAPACK_CHECK
void OPEN3D_LAPACK_CHECK(CLOUDVIEWER_CPU_LINALG_INT info, const std::string &msg)
Definition:
LinalgUtils.h:36
cloudViewer::core::SVDCPU
void SVDCPU(const void *A_data, void *U_data, void *S_data, void *VT_data, void *superb_data, int64_t m, int64_t n, Dtype dtype, const Device &device)
Definition:
SVDCPU.cpp:15
cloudViewer
Generic file read and write utility for python interface.
Definition:
AutoSegmentationTools.h:16
libs
cloudViewer
core
linalg
SVDCPU.cpp
Generated on Wed Jan 28 2026 09:00:54 for ACloudViewer by
1.9.1