git-svn-id: svn://db.shs.com.ru/pip@372 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -217,18 +217,6 @@ public:
|
||||
pid_size = os;
|
||||
return *this;
|
||||
}
|
||||
PIDeque<T> & align() {
|
||||
//printf("align %p\n", pid_data);
|
||||
if (!pid_data) return *this;
|
||||
T * p_d = (T*)(amalloc(pid_rsize*sizeof(T)));
|
||||
//printf("alloc %p\n", p_d);
|
||||
assert(p_d);
|
||||
memcpy(p_d, pid_data, pid_size*sizeof(T));
|
||||
free((uchar*)pid_data);
|
||||
pid_data = p_d;
|
||||
//printf("%p\n", p_d);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PIDeque<T> & insert(size_t index, const T & v = T()) {
|
||||
bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
|
||||
@@ -30,10 +30,7 @@
|
||||
//# include <crt_externs.h>
|
||||
extern clock_serv_t __pi_mac_clock;
|
||||
#endif
|
||||
#include <ctime>
|
||||
#ifdef QNX
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*! \class PISystemTime
|
||||
* \brief System time
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
|
||||
|
||||
#include "pistring.h"
|
||||
|
||||
#include <ctime>
|
||||
#ifdef QNX
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
//! \brief Sleep for "msecs" milliseconds
|
||||
void msleep(int msecs);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "pimathbase.h"
|
||||
#include "pitime.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
double piJ0(const double & v) {
|
||||
@@ -472,3 +473,14 @@ double randomn(double dv, double sv) {
|
||||
v0 = v0 * sqrt(-2 * log(s) / s);
|
||||
return v0 * sv + dv;
|
||||
}
|
||||
|
||||
|
||||
double randomd() {
|
||||
return (double)
|
||||
#ifdef QNX
|
||||
rand()
|
||||
#else
|
||||
random()
|
||||
#endif
|
||||
/ RAND_MAX * 2. - 1.;
|
||||
}
|
||||
|
||||
@@ -167,13 +167,7 @@ inline PIByteArray & operator >>(PIByteArray & s, complexld & v) {ldouble t0, t1
|
||||
|
||||
void randomize();
|
||||
// [-1 ; 1]
|
||||
inline double randomd() {return (double)
|
||||
#ifdef QNX
|
||||
rand()
|
||||
#else
|
||||
random()
|
||||
#endif
|
||||
/ RAND_MAX * 2. - 1.;}
|
||||
double randomd();
|
||||
// [-1 ; 1] normal
|
||||
double randomn(double dv = 0., double sv = 1.);
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
#define PIP_VERSION_MAJOR 0
|
||||
#define PIP_VERSION_MINOR 9
|
||||
#define PIP_VERSION_REVISION 4
|
||||
#define PIP_VERSION_SUFFIX "alpha"
|
||||
#define PIP_VERSION_SUFFIX "_prealpha"
|
||||
|
||||
#endif // PIVERSION_H
|
||||
|
||||
Reference in New Issue
Block a user