7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can someone help me to write a shell script to convert epoch timestamp into human readable format
1394553600,"test","79799776.0","19073982.728571","77547576.0","18835699.285714"
1394553600,"test1","80156064.0","19191275.014286","62475360.000000","14200554.720000"... (10 Replies)
Discussion started by: Moon1234
10 Replies
2. Shell Programming and Scripting
# date +%s -d "Mon Feb 11 02:26:04"
1360567564
# perl -e 'print scalar localtime(1360567564), "\n";'
Mon Feb 11 02:26:04 2013
the epoch conversion is working fine. but one of my application needs 13 digit epoch time as input
1359453135154
rather than 10 digit epoch time 1360567564... (3 Replies)
Discussion started by: vivek d r
3 Replies
3. Shell Programming and Scripting
Here is two time I have:
Jul 12 16:02:01
Jul 13 01:02:01
and how can I do a simple match to get difference between two time which is 09:00:00
Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies
4. Shell Programming and Scripting
Dear experts,
I have an epoch time input file such as : -
1302451209564
1302483698948
1302485231072
1302490805383
1302519244700
1302492787481
1302505299145
1302506557022
1302532112140
1302501033105
1302511536485
1302512669550
I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies
5. Shell Programming and Scripting
Hello
I have log file from solaris system which has date field converted by Java application using System.currentTimeMillis() function, example is 1280943608380 which equivalent to GMT: Wed, 04 Aug 2010 17:40:08 GMT.
Now I need a function in shell script which will convert 1280943608380... (3 Replies)
Discussion started by: Yaminib
3 Replies
6. UNIX Desktop Questions & Answers
Hi to all
Like in the subject, i got the problem with camera ID 0c45:613b Microdia Win2 PC Camera under Ubuntu. When i plug in camera to USB, Ubuntu put in sn9c102 module, but on this site Linux Kernel Driver Database: CONFIG_USB_GSPCA_SONIXJ: SONIX JPEG USB Camera Driver is information that... (0 Replies)
Discussion started by: m0z4rt
0 Replies
7. Solaris
Hi friends,
I am new to solaris and looking for a job, when ever i attend interview i get most of the questions on real time problems, every one sak me the same questions what are the problems you face daily.. and what are the types?
i know few like, disk extension,swap memory increasing,... (2 Replies)
Discussion started by: kurva
2 Replies
pcg(4rheolef) rheolef-6.1 pcg(4rheolef)
NAME
pcg -- conjugate gradient algorithm.
SYNOPSIS
template <class Matrix, class Vector, class Preconditioner, class Real>
int pcg (const Matrix &A, Vector &x, const Vector &b,
const Preconditioner &M, int &max_iter, Real &tol, odiststream *p_derr=0);
EXAMPLE
The simplest call to 'pcg' has the folling form:
size_t max_iter = 100;
double tol = 1e-7;
int status = pcg(a, x, b, EYE, max_iter, tol, &derr);
DESCRIPTION
pcg solves the symmetric positive definite linear system Ax=b using the Conjugate Gradient method.
The return value indicates convergence within max_iter (input) iterations(0), or no convergence within max_iter iterations(1). Upon suc-
cessful return, output arguments have the following values:
x approximate solution to Ax = b
max_iter
the number of iterations performed before the tolerance was reached
tol the residual after the final iteration
NOTE
pcg is an iterative template routine.
pcg follows the algorithm described on p. 15 in
@quotation Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, 2nd Edition, R. Barrett, M. Berry, T. F.
Chan, J. Demmel, J. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine, H. Van der Vorst, SIAM, 1994, ftp.netlib.org/templates/tem-
plates.ps. @end quotation
The present implementation is inspired from IML++ 1.2 iterative method library, http://math.nist.gov/iml++.
IMPLEMENTATION
template <class Matrix, class Vector, class Vector2, class Preconditioner, class Real, class Size>
int pcg(const Matrix &A, Vector &x, const Vector2 &Mb, const Preconditioner &M,
Size &max_iter, Real &tol, odiststream *p_derr = 0, std::string label = "cg")
{
Vector b = M.solve(Mb);
Real norm2_b = dot(Mb,b);
if (norm2_b == Real(0)) norm2_b = 1;
Vector Mr = Mb - A*x;
Real norm2_r = 0;
if (p_derr) (*p_derr) << "[" << label << "] #iteration residue" << std::endl;
Vector p;
for (Size n = 0; n <= max_iter; n++) {
Vector r = M.solve(Mr);
Real prev_norm2_r = norm2_r;
norm2_r = dot(Mr, r);
if (p_derr) (*p_derr) << "[" << label << "] " << n << " " << ::sqrt(norm2_r/norm2_b) << std::endl;
if (norm2_r <= sqr(tol)*norm2_b) {
tol = ::sqrt(norm2_r/norm2_b);
max_iter = n;
return 0;
}
if (n == 0) {
p = r;
} else {
Real beta = norm2_r/prev_norm2_r;
p = r + beta*p;
}
Vector Mq = A*p;
Real alpha = norm2_r/dot(Mq, p);
x += alpha*p;
Mr -= alpha*Mq;
}
tol = ::sqrt(norm2_r/norm2_b);
return 1;
}
rheolef-6.1 rheolef-6.1 pcg(4rheolef)