| /* ----------------------------------------------------------------------- *//** |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| *//* ----------------------------------------------------------------------- */ |
| |
| /* ------------------------------------------------------------------------ |
| * Dense cases |
| * ----------------------------------------------------------------------*/ |
| drop table if exists mat; |
| CREATE TABLE mat ( |
| row_id integer, |
| row_vec double precision[] |
| ); |
| |
| -- COPY mat (row_id, row_vec) FROM stdin delimiter '|'; |
| -- 1|{396,840,353,446} |
| -- 2|{691,58,899,163} |
| -- 3|{293,742,298,75} |
| -- 4|{462,532,787,265} |
| -- \. |
| |
| COPY mat (row_id, row_vec) FROM stdin delimiter '|'; |
| 1|{396} |
| \. |
| |
| drop table if exists svd_u; |
| drop table if exists svd_v; |
| drop table if exists svd_s; |
| drop table if exists svd_summary; |
| select svd('mat', 'svd', 'row_id', 1, NULL, 'svd_summary'); |
| |