-
Notifications
You must be signed in to change notification settings - Fork 0
/
kl_vector.cpp
731 lines (508 loc) · 19.1 KB
/
kl_vector.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
#include "kl_vsl.h"
klMemMgr* klGlobalMemoryManager::_globalMemoryManager=NULL;
void klGlobalMemoryManager::setklVectorGlobalMemoryManager(klMemMgr* mgr)
{
_globalMemoryManager=mgr;
}
//vzAdd Addition of vector elements
void klVSLAdd(klVector< complex<double > >& v,klVector< complex<double> >& b, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLAdd");
}
const __int64_t n = v.getColumns();
vzAdd( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vzSub Subtraction of vector elements
void klVSLSub(klVector< complex<double > >& v,klVector< complex<double> >& b, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLSub");
}
const __int64_t n = v.getColumns();
vzSub( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vzMul Multiplication of vector elements : elementwise
void klVSLMul(klVector< complex<double > >& v,klVector< complex<double> >& b, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLMul");
}
const __int64_t n = v.getColumns();
vzMul( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vzMul Multiplication of vector by conjugate of secong arg
void klVSLMulByConj(klVector< complex<double > >& v,klVector< complex<double> >& b, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLMulByConj");
}
const __int64_t n = v.getColumns();
vzMulByConj( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vzConj Conjugation of vector elements
void klVSLConj(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzConj( n, v.getMemory(),ans.getMemory());
}
//vzAbs Computation of the absolute value of vector elements
void klVSLAbs(klVector< complex<double > >& v ,klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAbs( n, v.getMemory(),ans.getMemory());
}
//vzArg Computation of the argument of vector elements
void klVSLArg(klVector< complex<double > >& v, klVector<double>& ans )
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzArg( n, v.getMemory(),ans.getMemory());
}
//vzDiv Division of elements of one vector by elements of the second vector
void klVSLDiv(klVector< complex<double > >& v,klVector< complex<double> >& b, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLDiv");
}
// Elementwise equal to the scalar
klVector<bool> checkNonZero =( b==complex<double>(0.0f,0.0f));
if(checkNonZero.sum()>0)
{
std::cerr<<"Warning : divide By zero in klVSLDiv check for Inf in result"<<endl;
{ANSI_INFO; throw klError(err + "Divide By Zeroin klSVLDiv");}
}
const __int64_t n = v.getColumns();
vzDiv( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vzSqrt Computation of the square root of vector elements
void klVSLSqrt(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzSqrt( n, v.getMemory(),ans.getMemory());
}
//vzPow Raising each vector element to the specified power
void klVSLPow(klVector< complex<double > >& v,klVector< complex<double> >& b, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLDiv");
}
const __int64_t n = v.getColumns();
vzPow( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vzPowx Raising each vector element to the constant power
void klVSLPowX(klVector< complex<double > >& v,complex< double> x, klVector< complex<double > >& ans )
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzPowx( n, v.getMemory(),x,ans.getMemory());
}
//vzExp Computation of the exponential of vector elements
void klVSLExp(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzExp( n, v.getMemory(),ans.getMemory());
}
//vzLn Computation of the natural logarithm of vector elements
void klVSLLn(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzLn( n, v.getMemory(),ans.getMemory());
}
//vzLog10 Computation of the denary logarithm of vector elements
void klVSLLog10(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzLog10( n, v.getMemory(),ans.getMemory());
}
//vzCos Computation of the cosine of vector elements
void klVSLCos(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzCos( n, v.getMemory(),ans.getMemory());
}
//vzSin Computation of the sine of vector elements
void klVSLSin(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzSin( n, v.getMemory(),ans.getMemory());
}
//vzTan Computation of the tangent of vector elements
void klVSLTan(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzTan( n, v.getMemory(),ans.getMemory());
}
//vzAcos Computation of the inverse cosine of vector elements
void klVSLAcos(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAcos( n, v.getMemory(),ans.getMemory());
}
//vzAsin Computation of the inverse sine of vector elements
void klVSLAsin(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAsin( n, v.getMemory(),ans.getMemory());
}
//vzAtan Computation of the inverse tangent of vector elements
void klVSLAtan(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAtan( n, v.getMemory(),ans.getMemory());
}
//vzCosh Computation of the hyperbolic cosine of vector elements
void klVSLCosh(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzCosh( n, v.getMemory(),ans.getMemory());
}
//vzSinh Computation of the hyperbolic sine of vector elements
void klVSLSinh(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzSinh( n, v.getMemory(),ans.getMemory());
}
//vzTanh Computation of the hyperbolic tangent of vector elements
void klVSLTanh(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzTanh( n, v.getMemory(),ans.getMemory());
}
//vzAcosh Computation of the inverse hyperbolic cosine of vector elements
void klVSLAcosh(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAcosh( n, v.getMemory(),ans.getMemory());
}
//vzAsinh Computation of the inverse hyperbolic sine of vector elements
void klVSLAsinh(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAsinh( n, v.getMemory(),ans.getMemory());
}
//vzAtanh Computation of the inverse hyperbolic tangent of vector elements
void klVSLAtanh(klVector< complex<double > >& v, klVector< complex<double > >& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
const __int64_t n = v.getColumns();
vzAtanh( n, v.getMemory(),ans.getMemory());
}
//------------------------double precision methods
//vdAdd Addition of vector elements
void klVSLAdd(klVector<double>& v,klVector<double>& b, klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLAdd");
}
const __int64_t n = v.getColumns();
vdAdd( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vdSub Subtraction of vector elements
void klVSLSub(klVector<double>& v,klVector<double>& b, klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLSub");
}
const __int64_t n = v.getColumns();
vdSub( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vdMul Multiplication of vector elements
void klVSLMul(klVector<double>& v,klVector<double>& b, klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLMul");
}
const __int64_t n = v.getColumns();
vdMul( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vdDiv Division of elements of one vector by elements of the second vector
void klVSLDiv(klVector<double>& v,klVector<double>& b, klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLSub");
}
const __int64_t n = v.getColumns();
vdDiv( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vdPow Raising each vector element to the specified power
void klVSLPow(klVector<double>& v,klVector<double>& b, klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLPow");
}
const __int64_t n = v.getColumns();
vdPow( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vdSqr Squaring of vector elements
void klVSLSqr(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdSqr( n, v.getMemory(),ans.getMemory());
}
//vdAbs Computation of the absolute value of vector elements
void klVSLAbs(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAbs( n, v.getMemory(),ans.getMemory());
}
//vdInv Inversion of vector elements
void klVSLInv(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdInv( n, v.getMemory(),ans.getMemory());
}
//vdSqrt Computation of the square root of vector elements
void klVSLSqrt(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdSqrt( n, v.getMemory(),ans.getMemory());
}
//vdPowx Raising each vector element to the constant power
void klVSLPowx(klVector<double>& v,double x,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdPowx( n, v.getMemory(),x,ans.getMemory());
}
//vdHypot Computation of the square root of sum of squares
void klVSLHypot(klVector<double>& v,klVector<double >& b,klVector<double>& ans)
{
vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
if(v.getColumns() != b.getColumns() )
{
ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLAdd");
}
const __int64_t n = v.getColumns();
vdHypot( n, v.getMemory(),b.getMemory(),ans.getMemory());
}
//vdExp Computation of the exponential of vector elements
void klVSLExp(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdExp( n, v.getMemory(),ans.getMemory());
}
//vdExpm1 Computation of the exponential of vector elements decreased by 1
void klVSLExpm1(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdExpm1( n, v.getMemory(),ans.getMemory());
}
//vdLn Computation of the natural logarithm of vector elements
void klVSLLn(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdLn( n, v.getMemory(),ans.getMemory());
}
//vdLog10 Computation of the denary logarithm of vector elements
void klVSLLog10(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdLog10( n, v.getMemory(),ans.getMemory());
}
//vdCos Computation of the cosine of vector elements
void klVSLCos(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdCos( n, v.getMemory(),ans.getMemory());
}
//vdSin Computation of the sine of vector elements
void klVSLSin(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdSin( n, v.getMemory(),ans.getMemory());
}
//vdTan Computation of the tangent of vector elements
void klVSLTan(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdTan( n, v.getMemory(),ans.getMemory());
}
//vdAcos Computation of the inverse cosine of vector elements
void klVSLAcos(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAcos( n, v.getMemory(),ans.getMemory());
}
//vdAsin Computation of the inverse sine of vector elements
void klVSLAsin(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAsin( n, v.getMemory(),ans.getMemory());
}
//vdAtan Computation of the inverse tangent of vector elements
void klVSLAtan(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAtan( n, v.getMemory(),ans.getMemory());
}
//vdCosh Computation of the hyperbolic cosine of vector elements
void klVSLCosh(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdCosh( n, v.getMemory(),ans.getMemory());
}
//vdSinh Computation of the hyperbolic sine of vector elements
void klVSLSinh(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdSinh( n, v.getMemory(),ans.getMemory());
}
//vdTanh Computation of the hyperbolic tangent of vector elements
void klVSLTanh(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdTanh( n, v.getMemory(),ans.getMemory());
}
//vdAcosh Computation of the inverse hyperbolic cosine of vector elements
void klVSLAcosh(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAcosh( n, v.getMemory(),ans.getMemory());
}
//vdAsinh Computation of the inverse hyperbolic sine of vector elements
void klVSLAsinh(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAsinh( n, v.getMemory(),ans.getMemory());
}
//vdAtanh Computation of the inverse hyperbolic tangent of vector elements
void klVSLAtanh(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdAtanh( n, v.getMemory(),ans.getMemory());
}
//vdErf Computation of the error function value of vector elements
void klVSLErf(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdErf( n, v.getMemory(),ans.getMemory());
}
//vdErfc Computation of the complementary error function value of vector elements
void klVSLErfc(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdErfc( n, v.getMemory(),ans.getMemory());
}
//vdCdfNorm Computation of the cumulative normal distribution function value of vector elements
void klVSLCdfNorm(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdCdfNorm( n, v.getMemory(),ans.getMemory());
}
//vdErfInv Computation of the inverse error function value of vector elements
void klVSLErfInv(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdErfInv( n, v.getMemory(),ans.getMemory());
}
//vdErfcInv Computation of the inverse complementary error function value of vector elements
void klVSLErfcInv(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdErfcInv( n, v.getMemory(),ans.getMemory());
}
//vdCdfNormInv Computation of the inverse cumulative normal distribution function value of vector elements
void klVSLCdfNormInv(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdCdfNormInv( n, v.getMemory(),ans.getMemory());
}
//vdLGamma Computation of the natural logarithm for the absolute value of the gamma function of vector elements
void klVSLLGamma(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdLGamma( n, v.getMemory(),ans.getMemory());
}
//vdTGamma Computation of the gamma function of vector elements
void klVSLTGamma(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdTGamma( n, v.getMemory(),ans.getMemory());
}
//vdFloor Rounding towards minus infinity
void klVSLFloor(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdFloor( n, v.getMemory(),ans.getMemory());
}
//vdCeil Rounding towards plus infinity
void klVSLCeil(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdCeil( n, v.getMemory(),ans.getMemory());
}
//vdTrunc Rounding towards zero infinity
void klVSLTrunc(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdTrunc( n, v.getMemory(),ans.getMemory());
}
//vdRound Rounding to nearest integer
void klVSLRound(klVector<double>& v,klVector<double>& ans)
{
const __int64_t n = v.getColumns();
vdRound( n, v.getMemory(),ans.getMemory());
}
////vzAdd Addition of vector elements. Smart Pointer Version. This design needs to be solidified.
//klComplexDoubleVectorPtr klVSLAdd(klComplexDoubleVectorPtr v,klComplexDoubleVectorPtr b, bool inplace=false)
//{
// vmlSetMode( VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_ERRNO );
// if(v->getColumns() != b->getColumns() )
// ANSI_INFO; throw klError(err + "Range Argument Exception in klVSLAdd";
// const __int64_t n = v->getColumns();
//
// if(!inplace)
// {
// klComplexDoubleVectorPtr ans= new klVector<complex<double> > (v->getColumns() );
//
// vzAdd( n, v->getMemory(),b->getMemory(),ans->getMemory());
// return ans;
// }
// else
// {
// vzAdd( n, v->getMemory(),b->getMemory(), v->getMemory());
// return v;
// }
//}
//vdNearbyInt Rounding according to current mode
//vdRint Rounding according to current mode and raising inexact result exception
//vdModf Computation of the integer and fractional parts