Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: plot.c

Issue 6893111: Enhancements to ktop (Closed) Base URL: ssh://gitrw.chromium.org:9222/ktop.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « plot.h ('k') | reduce.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 */ 4 */
5 5
6 #include <float.h> 6 #include <float.h>
7 #include <math.h> 7 #include <math.h>
8 #include <ncurses.h> 8 #include <ncurses.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 { 93 {
94 return sin(x/3) + 1; 94 return sin(x/3) + 1;
95 } 95 }
96 96
97 vector_s vinit(int n, double f(double)) 97 vector_s vinit(int n, double f(double))
98 { 98 {
99 vector_s v = new_vector(n); 99 vector_s v = new_vector(n);
100 point_s *p = v.p; 100 point_s *p = v.p;
101 point_s *end; 101 point_s *end;
102 double x; 102 double x;
103 » 103
104 for (x = 0, end = &v.p[n]; p < end; p++, x++) { 104 for (x = 0, end = &v.p[n]; p < end; p++, x++) {
105 p->x = x; 105 p->x = x;
106 p->y = f(x); 106 p->y = f(x);
107 } 107 }
108 return v; 108 return v;
109 } 109 }
110 110
111 void graph(void) 111 void graph(void)
112 { 112 {
113 graph_s g = { {0, 0}, { {10, 10}, {80, 10} } }; 113 graph_s g = { {0, 0}, { {10, 10}, {80, 10} } };
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 { 154 {
155 set_signals(); 155 set_signals();
156 init(); 156 init();
157 graph(); 157 graph();
158 refresh(); 158 refresh();
159 getchar(); 159 getchar();
160 cleanup(0); 160 cleanup(0);
161 return 0; 161 return 0;
162 } 162 }
163 #endif 163 #endif
OLDNEW
« no previous file with comments | « plot.h ('k') | reduce.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698