GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-norm.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2008-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_oct_norm_h)
27#define octave_oct_norm_h 1
28
29#include "octave-config.h"
30
31#include "mx-fwd.h"
32
33#include "oct-cmplx.h"
34
35// The remaining includes can be removed when the deprecated functions
36// at the end of this file are removed.
37
38#include "dColVector.h"
39#include "dRowVector.h"
40#include "fColVector.h"
41#include "fRowVector.h"
42
43namespace octave
44{
45 extern OCTAVE_API double xnorm (const ColumnVector&, double p = 2);
46 extern OCTAVE_API double xnorm (const RowVector&, double p = 2);
47 extern OCTAVE_API double xnorm (const Matrix&, double p = 2);
48 extern OCTAVE_API double xfrobnorm (const Matrix&);
49
50 extern OCTAVE_API double xnorm (const ComplexColumnVector&, double p = 2);
51 extern OCTAVE_API double xnorm (const ComplexRowVector&, double p = 2);
52 extern OCTAVE_API double xnorm (const ComplexMatrix&, double p = 2);
53 extern OCTAVE_API double xfrobnorm (const ComplexMatrix&);
54
55 extern OCTAVE_API float xnorm (const FloatColumnVector&, float p = 2);
56 extern OCTAVE_API float xnorm (const FloatRowVector&, float p = 2);
57 extern OCTAVE_API float xnorm (const FloatMatrix&, float p = 2);
58 extern OCTAVE_API float xfrobnorm (const FloatMatrix&);
59
60 extern OCTAVE_API float xnorm (const FloatComplexColumnVector&, float p = 2);
61 extern OCTAVE_API float xnorm (const FloatComplexRowVector&, float p = 2);
62 extern OCTAVE_API float xnorm (const FloatComplexMatrix&, float p = 2);
63 extern OCTAVE_API float xfrobnorm (const FloatComplexMatrix&);
64
65 extern OCTAVE_API double xnorm (const SparseMatrix&, double p = 2);
66 extern OCTAVE_API double xfrobnorm (const SparseMatrix&);
67
68 extern OCTAVE_API double xnorm (const SparseComplexMatrix&, double p = 2);
69 extern OCTAVE_API double xfrobnorm (const SparseComplexMatrix&);
70
71 extern OCTAVE_API RowVector xcolnorms (const Matrix&, double p = 2);
72 extern OCTAVE_API ColumnVector xrownorms (const Matrix&, double p = 2);
73
74 extern OCTAVE_API RowVector xcolnorms (const ComplexMatrix&, double p = 2);
75 extern OCTAVE_API ColumnVector xrownorms (const ComplexMatrix&, double p = 2);
76
77 extern OCTAVE_API FloatRowVector xcolnorms (const FloatMatrix&, float p = 2);
78 extern OCTAVE_API FloatColumnVector xrownorms (const FloatMatrix&, float p = 2);
79
80 extern OCTAVE_API FloatRowVector xcolnorms (const FloatComplexMatrix&, float p = 2);
81 extern OCTAVE_API FloatColumnVector xrownorms (const FloatComplexMatrix&, float p = 2);
82
83 extern OCTAVE_API RowVector xcolnorms (const SparseMatrix&, double p = 2);
84 extern OCTAVE_API ColumnVector xrownorms (const SparseMatrix&, double p = 2);
85
86 extern OCTAVE_API RowVector xcolnorms (const SparseComplexMatrix&, double p = 2);
87 extern OCTAVE_API ColumnVector xrownorms (const SparseComplexMatrix&, double p = 2);
88}
89
90#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
91OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
92inline double xnorm (const ColumnVector& v, double p = 2)
93{
94 return octave::xnorm (v, p);
95}
96
97OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
98inline double xnorm (const RowVector& v, double p = 2)
99{
100 return octave::xnorm (v, p);
101}
102
103OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
104inline double xnorm (const Matrix& m, double p = 2)
105{
106 return octave::xnorm (m, p);
107}
108
109OCTAVE_DEPRECATED (7, "use 'octave::xfrobnorm' instead")
110inline double xfrobnorm (const Matrix& m)
111{
112 return octave::xfrobnorm (m);
113}
114
115OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
116inline double xnorm (const ComplexColumnVector& v, double p = 2)
117{
118 return octave::xnorm (v, p);
119}
120
121OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
122inline double xnorm (const ComplexRowVector& v, double p = 2)
123{
124 return octave::xnorm (v, p);
125}
126
127OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
128inline double xnorm (const ComplexMatrix& m, double p = 2)
129{
130 return octave::xnorm (m, p);
131}
132
133OCTAVE_DEPRECATED (7, "use 'octave::xfrobnorm' instead")
134inline double xfrobnorm (const ComplexMatrix& m)
135{
136 return octave::xfrobnorm (m);
137}
138
139OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
140inline float xnorm (const FloatColumnVector& v, float p = 2)
141{
142 return octave::xnorm (v, p);
143}
144
145OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
146inline float xnorm (const FloatRowVector& v, float p = 2)
147{
148 return octave::xnorm (v, p);
149}
150
151OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
152inline float xnorm (const FloatMatrix& m, float p = 2)
153{
154 return octave::xnorm (m, p);
155}
156
157OCTAVE_DEPRECATED (7, "use 'octave::xfrobnorm' instead")
158inline float xfrobnorm (const FloatMatrix& m)
159{
160 return octave::xfrobnorm (m);
161}
162
163OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
164inline float xnorm (const FloatComplexColumnVector& v, float p = 2)
165{
166 return octave::xnorm (v, p);
167}
168
169OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
170inline float xnorm (const FloatComplexRowVector& v, float p = 2)
171{
172 return octave::xnorm (v, p);
173}
174
175OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
176inline float xnorm (const FloatComplexMatrix& m, float p = 2)
177{
178 return octave::xnorm (m, p);
179}
180
181OCTAVE_DEPRECATED (7, "use 'octave::xfrobnorm' instead")
182inline float xfrobnorm (const FloatComplexMatrix& m)
183{
184 return octave::xfrobnorm (m);
185}
186
187OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
188inline double xnorm (const SparseMatrix& m, double p = 2)
189{
190 return octave::xnorm (m, p);
191}
192
193OCTAVE_DEPRECATED (7, "use 'octave::xfrobnorm' instead")
194inline double xfrobnorm (const SparseMatrix& m)
195{
196 return octave::xfrobnorm (m);
197}
198
199OCTAVE_DEPRECATED (7, "use 'octave::xnorm' instead")
200inline double xnorm (const SparseComplexMatrix& m, double p = 2)
201{
202 return octave::xnorm (m, p);
203}
204
205OCTAVE_DEPRECATED (7, "use 'octave::xfrobnorm' instead")
206inline double xfrobnorm (const SparseComplexMatrix& m)
207{
208 return octave::xfrobnorm (m);
209}
210
211OCTAVE_DEPRECATED (7, "use 'octave::xcolnorms' instead")
212inline RowVector xcolnorms (const Matrix& m, double p = 2)
213{
214 return octave::xcolnorms (m, p);
215}
216
217OCTAVE_DEPRECATED (7, "use 'octave::xrownorms' instead")
218inline ColumnVector xrownorms (const Matrix& m, double p = 2)
219{
220 return octave::xrownorms (m, p);
221}
222
223OCTAVE_DEPRECATED (7, "use 'octave::xcolnorms' instead")
224inline RowVector xcolnorms (const ComplexMatrix& m, double p = 2)
225{
226 return octave::xcolnorms (m, p);
227}
228
229OCTAVE_DEPRECATED (7, "use 'octave::xrownorms' instead")
230inline ColumnVector xrownorms (const ComplexMatrix& m, double p = 2)
231{
232 return octave::xrownorms (m, p);
233}
234
235OCTAVE_DEPRECATED (7, "use 'octave::xcolnorms' instead")
236inline FloatRowVector xcolnorms (const FloatMatrix& m, float p = 2)
237{
238 return octave::xcolnorms (m, p);
239}
240
241OCTAVE_DEPRECATED (7, "use 'octave::xrownorms' instead")
242inline FloatColumnVector xrownorms (const FloatMatrix& m, float p = 2)
243{
244 return octave::xrownorms (m, p);
245}
246
247OCTAVE_DEPRECATED (7, "use 'octave::xcolnorms' instead")
248inline FloatRowVector xcolnorms (const FloatComplexMatrix& m, float p = 2)
249{
250 return octave::xcolnorms (m, p);
251}
252
253OCTAVE_DEPRECATED (7, "use 'octave::xrownorms' instead")
254inline FloatColumnVector xrownorms (const FloatComplexMatrix& m, float p = 2)
255{
256 return octave::xrownorms (m, p);
257}
258
259OCTAVE_DEPRECATED (7, "use 'octave::xcolnorms' instead")
260inline RowVector xcolnorms (const SparseMatrix& m, double p = 2)
261{
262 return octave::xcolnorms (m, p);
263}
264
265OCTAVE_DEPRECATED (7, "use 'octave::xrownorms' instead")
266inline ColumnVector xrownorms (const SparseMatrix& m, double p = 2)
267{
268 return octave::xrownorms (m, p);
269}
270
271OCTAVE_DEPRECATED (7, "use 'octave::xcolnorms' instead")
272inline RowVector xcolnorms (const SparseComplexMatrix& m, double p = 2)
273{
274 return octave::xcolnorms (m, p);
275}
276
277OCTAVE_DEPRECATED (7, "use 'octave::xrownorms' instead")
278inline ColumnVector xrownorms (const SparseComplexMatrix& m, double p = 2)
279{
280 return octave::xrownorms (m, p);
281}
282#endif
283
284#endif
Definition: dMatrix.h:42
#define OCTAVE_API
Definition: main.in.cc:55
double xfrobnorm(const Matrix &x)
Definition: oct-norm.cc:585
ColumnVector xrownorms(const Matrix &m, double p)
Definition: oct-norm.cc:628
RowVector xcolnorms(const Matrix &m, double p)
Definition: oct-norm.cc:628
double xnorm(const ColumnVector &x, double p)
Definition: oct-norm.cc:585