]> gitweb.michael.orlitzky.com - octave.git/blobdiff - c_norm.m
Add the c_norm function and l2_project functions.
[octave.git] / c_norm.m
diff --git a/c_norm.m b/c_norm.m
new file mode 100644 (file)
index 0000000..865ff8b
--- /dev/null
+++ b/c_norm.m
@@ -0,0 +1,20 @@
+function c_norm = c_norm(w, a, b, v)
+  ##
+  ## The norm on C[a,b] induced by c_inner_product.
+  ##
+  ## INPUT:
+  ##
+  ##   * ``w`` -- The weight function.
+  ##
+  ##   * ``a`` -- The left endpoint of the interval.
+  ##
+  ##   * ``b`` -- The right endpoint of the interval.
+  ##
+  ##   * ``v`` -- The vector.
+  ##
+  ## OUTPUT:
+  ##
+  ## The norm of `v`; that is, the inner product sqrt(<v, v>).
+  ##
+  c_norm = sqrt(c_inner_product(w, a, b, v, v));
+end