[eigen] calculating on ranges |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] calculating on ranges
- From: Jos van den Oever <jvdoever@xxxxxxxxx>
- Date: Tue, 27 Jan 2009 13:40:14 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=MVDpYBMruafjAO+atMnZwzlLKIvPGsLrwQ5bLnZqCkQ=; b=OIp4dwp7/yXxnJXaI1iD5gSlDFb5cRT74e/5wMGY5nhWahwOKEH+HrqGO5OeWPiucb BCU9UPZHnjWANu3KgLBwb75g4+p34SBPfpggvR2CXtinmkc4BXiU7VAMonwe6FOCfsiE w6a+uB6zHBy8scl85hQxwgPkX0PUZ/OAON5dU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=XKOU+I01ErgjchugLSzg0gNJ3h2dF0BoVxUMOiI6WLRDcHX8rqjfIA3aSqLJ1mOzRa WPDwkt4G+QNjFozF+g/a/4N/+mltrouHWs3UyzsAOtn4xQqA3MK8hEoKKnRpWdVHaA8Y Yxq4lV39fpedVkntKA3q8/LaQnL3FE5O2RenU=
Hi all,
For calculating curves which consist of multiple peaks, I'd like
evaluate a function on a certain range.
Suppose I have a axis with a 100 data points specified in vector x and
two gaussians that have a significant value over only a small range
(data points 10-20 and data point 50-60). The value of the gaussians
is neglected at other points.
The gaussians can be added to the curve by two calls to this function:
void
addGaussianToCurve(const double*x, double* y, int start, int end,
double a, double b, double c) {
for (int i=start; i<= end; ++i) {
y[i] += a*exp(-pow(x[i]-b, 2)/c);
}
}
Would Eigen offer a more advantageous/faster way of implementing this
function where only a certain range of a vector is used?
Cheers,
Jos